I’m trying to categorize a custom field like this:
CASE
WHEN REGEXP_MATCH(Campaign, "BLU") THEN "Colour Blue"
WHEN REGEXP_MATCH(Campaign, "GRE") THEN "Colour Green"
WHEN REGEXP_MATCH(Campaign, "CAR") THEN "Product Car"
WHEN REGEXP_MATCH(Campaign, "MOT") THEN "Product Motorbike"
END
It works fine for campaigns with only one “tag”, like MOT
or GRE
, for example.
I have also campaigns with more than one tag, for example CAR+GRE
, and the REGEXP only returns the first true condition, in this case, CAR
. But I’m not able to categorize both, CAR
and GRE
.