Using CASE WHEN in CUSTOM dimensions

Hello community

As we know we can currently use CASE WHEN statement in custom dimension as follows;

case(when(${customer_account.iso_country_code}= "US","yes"),
when(${customer_account.iso_country_code}= "CA","yes")

,"no")

As we see, we have to write WHEN clause multiple times. Do we have a workaround in order to avoid writing WHEN multiple times, sth like this;

case(when(${customer_account.iso_country_code}IS IN ("US","CA"),"yes"),"no")

It gives an ‘Expression incomplete’ error as expected. Apart from CASE WHEN statement, do we have alternative workarounds to make this logic work. Because writing WHEN 20 times (depending on the use case) seems not to be scalable solution.

Help is appreciated.

0 0 276
0 REPLIES 0
Top Labels in this Space
Top Solution Authors