Search code examples
caselooker-studio

How can I change the text values in Google Data Studio?


I have a field called duration_type that can have the values below and I want to show them in my graphs as the expected_values field:

duration_type expected_values
weekly Week
monthly Month
annual Year

Solution

  • Make a new expected_values field and create the CASE statement:

    CASE
      WHEN duration_type = "weekly" THEN "Week"
      WHEN duration_type = "monthly" THEN "Month"
      WHEN duration_type = "annual" THEN "Year"
    END