Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All, I have a requirement where I have to bring one filed from an excel file loaded into a QVD which also is loaded in the script. I used applymap function but its not working. The Key field used to join is not working. Any help is appreciated.
For example,
table1:
Load
field1,
filed2 ,
field1 & field 2 as key,
field 3
etc from excel file;
mapping load:
key ,
field 3
resident table1;
table2:
load
field 1
field 2,
applymap('maping table',key,null()) as field 3
from QVD;
I want to bring field 3 into table2
load
field1 & field 2 as key,
field 1
field 2,
applymap('maping table',key,null()) as field 3
from QVD;
Can you pls give full approx. script , for ex where should I put they "Key" field? in all three tables: table1, mapping load and table 2?
please post some sample data and your expected result.
thanks
table1:
Load
field1,
filed2 ,
field1 & field 2 as key,
field 3
etc from excel file;
mapping load:
key ,
field 3
resident table1;
table2:
load
field1 & field 2 as key,
field 1,
field 2,
applymap('maping table',key,null()) as field 3
from QVD;
Something is incomplete here. You show a reference to 'maping table' but don't show it loading in the script.
-Rob
Hi @niranjana
Problem with your script is that you are not defining correct mapping field in your 3rd table i.e. qvd table
While there can be multiple ways to handle this, you can try the below script and let me know if it works for you
Table1:
Load
field1,
filed2 ,
field1 & field2 as key,
field 3
etc from excel file;
Mapping Table:
mapping load
key,
field 3
resident Table1;
Table2:
load
field 1
field 2,
applymap('Maping Table',field1 & field2,null()) as field 3
from QVD;
Also note that mapping load table can only have unique values.