Skip to Content
-2

Calculated Column Script

Jul 13, 2017 at 08:07 AM

75

avatar image

Hi Experts,

Can you please advise on how I would implement below logic in a Calculated Column in a CV?

SQL or Column doesn't matter.

CASE WHEN Customer = 2 AND (CATEGORY NOT IN ('500', '250') OR GROUP IN ('a','b')) THEN AMOUNT ELSE 0

Thanks,

DJ

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Florian Pfeffer
Jul 13, 2017 at 03:37 PM
1

Hello David,

by checking the HANA Miscellaneous Functions for modeling you should be able to solve the requirement by yourself.

A simple solution would be to use the "if" function in a calculation engine calculated column (consider that you use the right upper/lower case names of your columns).

if("Customer" = 2 and (("CATEGORY" <> '500' and "CATEGORY" <> '250') or "GROUP" = 'a' or "GROUP" = 'b')),"AMOUNT",0)

Regards,
Florian

Share
10 |10000 characters needed characters left characters exceeded