Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all i have a requirement where i want to bring 3 fields using applymap
Table1
Id
1
2
3
Table2
Id country region age
1 i a 26
2 b c 11
How can i achieve it
You can either JOIN the tables
or
MAP:
MAPPING
LOAD Id, country &'|'& region &'|'& age as value
FROM Table2;
LOAD Id,
Subfield( Applymap('MAP', Id), '|',1) as country,
Subfield( Applymap('MAP', Id), '|',2) as region,
Subfield( Applymap('MAP', Id), '|',3) as age,
...
If I understand,
you can use a separator in the second field of fhe mapping table
MapTable:
Mapping load * inline [
f1, f2
1, i|a|26
2, b|c|11
];
X:
load
f,
subfield(ApplyMap('MapTable', f,), '|', 1) as m1,
subfield(ApplyMap('MapTable', f,), '|', 2) as m2,
subfield(ApplyMap('MapTable', f,), '|', 3) as m3
inline [
f
1
2
];
You can either JOIN the tables
or
MAP:
MAPPING
LOAD Id, country &'|'& region &'|'& age as value
FROM Table2;
LOAD Id,
Subfield( Applymap('MAP', Id), '|',1) as country,
Subfield( Applymap('MAP', Id), '|',2) as region,
Subfield( Applymap('MAP', Id), '|',3) as age,
...
Thank you stefan it solved the problem
I have another roblem which is cracking my mind can you please help me please