Hoping someone can help!
I am trying to custom sort a table in data studio.
Here is the code I am using:
CASE
WHEN REGEXP_MATCH(Event Label, "(?i)Search cars - button click") THEN 9
WHEN REGEXP_MATCH(Event Label, "(?i)Renter - search performed (step 1)") THEN 8
WHEN REGEXP_MATCH(Event Label, "(?i)Renter - car details page (step 2)") THEN 7
WHEN REGEXP_MATCH(Event Label, "(?i)Renter - instant book - button click (step 3)") THEN 6
WHEN REGEXP_MATCH(Event Label, "(?i)Returning Renter - Login (step 4)")THEN 5
WHEN REGEXP_MATCH(Event Label, "(?i)Renter - Registration complete (step 4)") THEN 4
WHEN REGEXP_MATCH(Event Label, "(?i)Renter - extras - continue click (step 5)") THEN 3
WHEN REGEXP_MATCH(Event Label, "(?i)Renter - payment complete - deposit paid (step 6)") THEN 2
WHEN REGEXP_MATCH(Event Label, "(?i)Renter - payment complete - booking confirmed (step 7)") THEN 1
ELSE 0
END
I would like '9' to be the first row, '8' to be the second below it, etc.
However, when I apply, the table is not reflecting this order. Is my code wrong? I am not getting an error when running it.
I am using the filter in the 'Sort' field as per the screenshot below.
Notice your custom field is being treated as a metric:
How to notice: Field is blue, and the aggregation function is displayed in the left (=SUM).
This way, the individual numbers of this are being summarized before sorting. In short, to solve your problem, you need to make this field be green (so it is treated as a dimension).
Since I don't have access to your dashboard, I listed some options you may try to follow: