Using CASE WHEN in CUSTOM dimensions

  • 27 October 2021
  • 0 replies

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")


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 replies

Be the first to reply!