Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
i have a data-set as follow. I would like to implement in the loading script a FLAG that should be equal to Y if on the order_number is contained the item number=AAAA.
Which could be best way to do this?
THanks!
HI @qlikviewaf
Try like below
Table1:
LOAD Region, OrderNumber, Item, OrderType, Amount from ursourcetable;
Join
Load OrderNumber, 'Y' as Flag Resident Table1 Where Item = 'AAAA';
Hope it helps
What if for the same order i got 2 item AAAA listed ?
I guess that the join below, needs to be adjusted in order to load only first row found, avoiding duplicates then. It make sense ? how can this be done
Join
Load OrderNumber, 'Y' as Flag Resident Table1 Where Item = 'AAAA';
Thanks!
Hi @qlikviewaf ,
I would choose ApplyMap approach, iow fast lookup. In script editor do the following:
MAP: //select order numbers where item = AAAA
mapping load distinct
OrderNumber,
'Y'
from XXX
where Item = 'AAAA';
final table:
Load *,
ApplyMap('MAP',OrderNumber,'N') as Flag
From XXX;
BR
m
HI @qlikviewaf
You can use distinct load
Join
Load distinct OrderNumber, 'Y' as Flag Resident Table1 Where Item = 'AAAA';
Or
you can use Applymap as suggested by @mato32188