Skip to Content
avatar image
Former Member

Use IN operator to create Calculated Column

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Jan 21, 2015 at 06:43 AM

    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

    Add comment
    10|10000 characters needed characters exceeded