Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
deep2021
Creator III
Creator III

Multiple applymaps

Hi, 

 

I have a number of applymaps in my script. Could you please help me out, how to write the applymaps with mapping load using subfield function.

Thanks,

Labels (4)
1 Solution

Accepted Solutions
marcus_sommer

To reduce the number of needed mappings in the case you need to apply more than one value you could string-concat the return values like:

m: mapping load LookupKey, F1 & '|' & F2 & '|' & F3 inline [
LookupKey, F1, F2, F3
1, x, y, z
2, a, b, c
];

and then you call them as an example with:

t: load *, subfield(applymap('m', LookupKey, 'default ...'), '|', 2) as F2
from Source;

- Marcus

View solution in original post

4 Replies
Jayavignesh
Contributor III
Contributor III

You can pass the reference with subfield function in applymap.

ApplyMap('map_name', Subfield(field1,',')[ , default_mapping ] )

 

deep2021
Creator III
Creator III
Author

can you please share an example for the same?

Jayavignesh
Contributor III
Contributor III

Would be good if you share a qvf/qvw

marcus_sommer

To reduce the number of needed mappings in the case you need to apply more than one value you could string-concat the return values like:

m: mapping load LookupKey, F1 & '|' & F2 & '|' & F3 inline [
LookupKey, F1, F2, F3
1, x, y, z
2, a, b, c
];

and then you call them as an example with:

t: load *, subfield(applymap('m', LookupKey, 'default ...'), '|', 2) as F2
from Source;

- Marcus