Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I want to use the below SQL code in the load , how i can do this :
SELECT SUM(CASE WHEN ORG_ID IN(658,657,661,678,663,659,662,660)
THEN SUM (GSV - DISCOUNT)
ELSE SUM (GSV) END) Value
FROM TABLE;
I've tried the below in my qlik load , but don't know how to pass multiple values for ORG_ID :
If ( ORG_ID=(658) ,GSV-DISCOUNT ,GSV ) as Value ,
Regards,
Adil
Hi Adil,
One way of handling that is using Match()
If(Match(ORG, 658, 657, 661, 678) > 0, GSV - DISCOUNT, GSV) AS Value
If values are literals instead of numbers, use single quotes to separate them
If(Match(ORG, 'AA', 'BB', 'CC', 'DD') > 0, GSV - DISCOUNT, GSV) AS Value
Miguel
Hi Adil,
One way of handling that is using Match()
If(Match(ORG, 658, 657, 661, 678) > 0, GSV - DISCOUNT, GSV) AS Value
If values are literals instead of numbers, use single quotes to separate them
If(Match(ORG, 'AA', 'BB', 'CC', 'DD') > 0, GSV - DISCOUNT, GSV) AS Value
Miguel