Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi team,
Can any one help to my requirement.i have 2 tables,if req value= wh1 value exit lopp other wise it has to check wh2,wh3...like so on..
when ever condition met need to exit loop.
table1
S.no | wh1 | wh2 | wh3 | wh4 | wh5 | wh6 |
---|---|---|---|---|---|---|
1 | a | b | c | d | e | f |
2 | b | c | d | e | f | g |
3 | c | d | e | f | g | h |
4 | d | e | f | g | h | i |
5 | e | f | g | h | i | j |
6 | f | g | h | i | j | k |
7 | g | h | i | j | k | l |
8 | h | i | j | k | l | m |
9 | i | j | k | l | m | n |
10 | j | k | l | m | n | o |
table2
S.no | req |
---|---|
1 | a |
2 | b |
3 | c |
4 | d |
5 | e |
6 | f |
7 | g |
8 | h |
9 | i |
10 | j |
11 | k |
12 | l |
13 | m |
14 | n |
15 | o |
Is this something you would have done in the load script or in the app at runtime?
Could you please be more specific about your requirements? What do you mean by loop and exit the loop?
What is the condition that should be met? Is it each value of wh1 column against each value of req column with matching S.no?
Maybe this?
if yes this is the script
A:
LOAD S.no, wh1, wh2, wh3, wh4, wh5, wh6
FROM [https://community.qlik.com/thread/198984] (html, codepage is 1252, embedded labels, table is @1);
B:
LOAD S.no, req
FROM [https://community.qlik.com/thread/198984] (html, codepage is 1252, embedded labels, table is @2);
for i=1 to 6
MapWh$(i): Mapping LOAD wh$(i), 'wh$(i)' Resident A;
next;
Left Join (B)
load
S.no,
ApplyMap('MapWh1', req,
ApplyMap('MapWh2', req,
ApplyMap('MapWh3', req,
ApplyMap('MapWh4', req,
ApplyMap('MapWh5', req,
ApplyMap('MapWh6', req, 'No match'
)))))) as Result
Resident B;