Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have two tabels:
Mapping_Table:
Key | Text |
---|---|
1 | England |
2 | Germany |
3 | Japan |
Data_Table:
Key |
---|
1, 2 |
3 |
1, 2, 3 |
I want the table:
Text |
---|
England, Germany |
Japan |
England, Germany, Japan |
Is this possible, to map multiple values?
Thanks
hello
maybe something like that
map:
mapping load * inline [
Key,Text
1,England
2,Germany
3,Japan
];
data:
load * inline [
Key
1,2
3
1,2,3
] (delimiter is ' ');
for i=0 to NoOfRows('data')-1
let vOutput='';
let vListKey=Peek('Key',i,'data');
trace ** $(vListKey) **;
for j=1 to SubStringCount(vListKey,',')+1
let vKey=SubField(vListKey,',',j);
trace *** $(vKey) ***;
let vOutput=vOutput & ApplyMap('map',vKey,'***')&',';
next j
let vOutput=left(vOutput,len(vOutput)-1);
Outp:
load '$(vListKey)' as K,
'$(vOutput)' as T
AutoGenerate(1);
next i
exit script;
Try like:
Map:
Mapping Load * Inline [
Key, Text
1, England
2, Germany
3, Japan
];
Data_Table:
Load
Key,
Concat(MappedSeparated, ',') as MaapedKey
Group By Key;
Load
Key,
ApplyMap('Map', SeparatedKey) as MappedSeparated
;
Load
Key,
SubField(Key, ',') as SeparatedKey;
Load * Inline [
Key
1, 2
3
1, 2, 3] (delimiter is '|');
Hi Alexander,
If "Key" is a field in your "Data_Table", you can use MapSubString function.
Map:
Mapping LOAD Key,
Text
FROM
[https://community.qlik.com/thread/306964]
(html, codepage is 1252, embedded labels, table is @1);
Data:
LOAD MapSubString('Map',Key) as Text
FROM
[https://community.qlik.com/thread/306964]
(html, codepage is 1252, embedded labels, table is @2);