Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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,
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
You can pass the reference with subfield function in applymap.
ApplyMap('map_name', Subfield(field1,',')[ , default_mapping ] )
can you please share an example for the same?
Would be good if you share a qvf/qvw
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