4 Replies Latest reply on Jan 15, 2019 3:08 AM by Puja Doona

    CASE statement question

    Puja Doona

      Situation -> In a country multiple brands operate. I want to create a CASE statement to capture the 'brand' per the available data where when {sale_country=US} or {sale_country=CA}

      then {brand=A} or/and {brand=B} or/and {brand=C} 

       

      So I wrote is as below:

       

      CASE [sale_country]

       

      WHEN 'US' THEN 'brand=A'

      WHEN 'CA' THEN 'brand=A'

       

      WHEN 'US' THEN 'brand=B'

      WHEN 'CA' THEN 'brand=B'

       

      WHEN 'US' THEN 'brand=C'

      WHEN 'CA' THEN 'brand=C'

       

      ELSE 'Rest'

       

      END

       

      But its just picking the first brand when selecting {sale_country=US} and NOT the rest.

       

      How can I fix this so that it displays data for all brands operating in a certain {sale_country}?