Discussion Board for collaboration on QlikView Scripting.
I was trying to create a flag which distinguishes special and normal orders.
Order, Product, INS
12345 ABC Y
12345 DEF Y
If an order has atleast one INS specified then it by default becomes special type and give 'Y' .
Only if the order has no INS, then give 'N'.
Flag Y has only 12345
Flag N has only 67891
Any help is highly appreciated.
Go to Solution.
Table1: LOAD * Inline [ Order, Product, INS 12345,ABC,Y 12345,DEF,Y 12345,GHI 12345,JKL 67891,TYU ]; Table2: LEFT JOIN LOAD Order, If(Maxstring(INS) = 'Y', 'Y', 'N') as Flag Resident Table1 GROUP BY Order;
May be this:
If(Len(Trim(INS)) > 0, INS) as INS;
LOAD * Inline [
12345, ABC, Y
12345, DEF, Y
LOAD DISTINCT Order,
'Y' as INS1
Where INS = 'Y';
If(Len(Trim(INS1)) = 0, 'N', INS1) as INS,
DROP Table Table;
load Order, if(match(MaxString(INS), 'Y'), 'Y', 'N') as Flag
group by Order;
EDIT: ops, swuehl already answered
Thanks bro. Sunny