Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Good Day Qlik Community!
I have a scenario that i'm struggling with?
If i have these 2 Data Sets:
Table 1:
ID | Desc |
1 xxx
2 xxx
3 xxx
4 xxx
5 xxx
Table 2:
ID | Desc |
2 xxx
3 xxx
5 xxx
Therefore IDs: 2, 3, 5 will have links.
How can i create a flag, 2 options: Linked and Not Linked?
In the actual scenario a situation of: Invoiced, not invoiced?
Any/all responses will be appreciated.
Nico
Table2Map:
MAPPING LOAD
ID,
Desc
FROM Data Source;
Table1:
LOAD
IF(ISNULL(APPLYMAP('Table2Map',ID,NULL())),'Not Linked','Linked') as _linkFlag
ID,
Desc,
FROM Data Source;
Table2 ...etc.
If you have all values from table 2 contained in table 1 then simply :
MyTabTemp:
load id, desc1 from table1
left join
load id, desc2, '1' as flag from table2;
Where you find '1' values as flag there is a link ...
Let me know
Using the Resident Function?
Table1:
Load
ID,
Desc
FROM Date Source;
Left Join
Table 2:
Load
ID,
Desc,
'Linked' as _tempflag
From Data Source;
Load
ID
Desc,
IF(_tempflag='Linked','Linked','Not Linked') as _flag
Resident Table1;
Perfect!
Changed it up a bit! But works like a charm!
Thumbs up!
Michael Gardner wrote:
Table1:
Load
ID,
Desc
FROM Date Source;
Left Join
Table 2:
Load
ID,
Desc,
'Linked' as _tempflag
From Data Source;
Load
ID
Desc,
IF(_tempflag='Linked','Linked','Not Linked') as _flag
Resident Table1;