cancel
Showing results for 
Search instead for 
Did you mean: 

Use IN operator to create Calculated Column

Former Member

Dear Experts,

I have following requirements that will use IN operators.

the column A have these values (COIN, KOVO,RKU1, COIE......) and Column B have these values (A, S, H, L) now if column "A" IN ('COIN', 'RKU1','COIE') AND Column B NOT IN ('A','L') Then 'S' elseif Column B IN ('A','L') then 'H' else Column B.

so I have tried to use the below syntax in HANA

If("A" IN ('COIN','RKU1','COIE') AND "B" NOT IN ('A','L'),'S',if("B" IN ('A','L'),'H',"B"))

but it wont validate says invalid expression, so we can't use IN operators in Calculated column? or how I will achieve this logic?

Please advise.

Thanks,

Karuppiah N

Accepted Solutions (1)

Accepted Solutions (1)

former_member210482
Active Participant

Hi Karuppaih,

Your syntax is not proper. It takes as in("attr",[values]). So your logic will look like this.

If(IN ("A",'COIN','RKU1','COIE') AND NOT IN ("B",'A','L'),'S',if(IN ("B",'A','L'),'H',"B"))

Let me know if your still facing the issue.

Regards,

Safiyu

Former Member
0 Kudos

Many thanks Safiyu,

It works for me and I have achieved the logic.

Regards

Karuppiah N

former_member210482
Active Participant
0 Kudos

Hi Karuppaih,

Your welcome.

Regards,

Safiyu

Answers (0)