Hi,
I need some help with case statement, all looks correct with exception of the last when statement which does not return anything, I think that is because the Accounts are used in prior when statements. Is there a way to get the last statement to work?
CASE
WHEN "Account" IN (1,2) AND "Currency"."Currency Code" = 'USD' THEN 'IC'
WHEN "Account" IN (3,4) AND "Currency"."Currency Code" = 'USD' THEN 'P'
WHEN "Account" IN (5) AND "Currency"."Currency Code" = 'STAT' THEN 'M'
WHEN "Account" IN (6,7) AND "Currency"."Currency Code" = 'USD' THEN 'NS'
WHEN "Account" IN (8) AND "Currency"."Currency Code" = 'USD' THEN 'OP'
WHEN "Account" IN (9) AND "Currency"."Currency Code" = 'USD' THEN 'CL'
WHEN "Account" IN (1,2,3,4,6,7,8,9) AND "Currency"."Currency Code" = 'USD' THEN 'GR'
ELSE '' END
Thanks
Z