Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a data set like this
First table:
Itemid | Item | Amount | Addr |
---|---|---|---|
1 | Item 0 | 30 | FA |
2 | Item1 | 30 | CA |
3 | Item2 | 89 | |
4 | Item3 | 89 |
Second table:
Item ID | Addr |
---|---|
3 | QA |
4 | C2 |
I need to merge these tables in the load script so it can fill addr column of First table with the missing value.
Output table:
Itemid | Item | Amount | Addr |
---|---|---|---|
1 | Item 0 | 30 | FA |
2 | Item1 | 30 | CA |
3 | Item2 | 89 | QA |
4 | Item3 | 89 | C2 |
What would be the most efficient way to do it?
Thanks
Use Mapping Load!
Map:
Mapping Load
[Item ID] as Itemid,
Addr
FROM [https://community.qlik.com/thread/302853]
(html, codepage is 1252, embedded labels, table is @2);
Final:
LOAD Itemid,
Item,
Amount,
if(Addr='',ApplyMap('Map',Itemid),Addr) as Addr
FROM [https://community.qlik.com/thread/302853]
(html, codepage is 1252, embedded labels, table is @1) ;
hope this helps
Use Mapping Load!
Map:
Mapping Load
[Item ID] as Itemid,
Addr
FROM [https://community.qlik.com/thread/302853]
(html, codepage is 1252, embedded labels, table is @2);
Final:
LOAD Itemid,
Item,
Amount,
if(Addr='',ApplyMap('Map',Itemid),Addr) as Addr
FROM [https://community.qlik.com/thread/302853]
(html, codepage is 1252, embedded labels, table is @1) ;
hope this helps
I had to rename the field else it worked fine.
Thanks