Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Case Statement OTBI

User_3T7AJDec 8 2021

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

This post has been answered by Frank Kulash on Dec 9 2021
Jump to Answer
Comments
Post Details
Added on Dec 8 2021
14 comments
5,510 views