Display list of values in same column in Looker Studio

197 views Asked by At

I'm pretty new to Looker Studio and formulas and haven't been able to find anything that can help me with the particular challenge I'm facing.

I have page paths with multiple queries. For example:

/locations?community[]=32&search=Nursing&type_of_service[]=250&type_of_service[]=256&type_of_service[]=273

As you can see, there are three type_of_service[] queries, each with a different number. The number corresponds to a text label. So, for instance, 250 could correspond to Long term care.

I want to have a Type of service column that lists all the text labels used in the URL. So, the output would look something like:

Type of service
Long term care, continuing care, acute care

So far, I've only created a Location queries parameter for my data source:

--Location parameter extracts everything after the '?' in the page path
CASE
  WHEN REGEXP_CONTAINS(Page path + query string, 'locations')
  THEN REGEXP_EXTRACT(Page path + query string, r'\?(.*)')
  ELSE '(not used)'
END

Then I created a Type of care dimension:

CASE
  WHEN CONTAINS_TEXT(Location queries, 'type_of_care') THEN
  CASE
    WHEN CONTAINS_TEXT(Location queries, '250') THEN 'Long term care'
  END
END

But now I don't know how to add the other labels from the other type_of_service[] queries.

Am I going about this the wrong way?

0

There are 0 answers