Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have below mapping load table
ID ,Text
002 ,text1
2 ,text2
when applymap is applied, it default takes to 2 for even 002. How can I fix it to exact?
Yes, it works if you observe the rule that only text values are stored, and that QlikView should be blocked from interpreting and passing dual values with a numerical component to search for.
Anyway it shoyuld be easy to figure out what works and what doesn't. I used this code (copied from your post)
MT:
Mapping
LOAD Text(ID) as ID, Text INLINE [
ID, Text
2, Text1
02, Text2
002, Text3
0002, Text4
];
LET vTest1 = applymap('MT', 2, 'NotFound');
LET vTest2 = applymap('MT', '02', 'NotFound');
LET vTest3 = applymap('MT', text('002'), 'NotFound');
to get this result
Peter
[Edit] Attached the example document to further play with.
May be load ID field in the mapping table using Text() function:
MappingTable:
Mapping
LOAD Text(ID) as ID,
Text
FROM....
The reason is that a Mapping Table acts like a symbol table with dual values. Identical numerical values cannot have different text values, just like dual values.
pcammaert -
So it won't work even if force Text() function to it? Have not tested what I proposed, but I wonder if you already have tested this or know this for fact.
Best,
Sunny
Yes, it works if you observe the rule that only text values are stored, and that QlikView should be blocked from interpreting and passing dual values with a numerical component to search for.
Anyway it shoyuld be easy to figure out what works and what doesn't. I used this code (copied from your post)
MT:
Mapping
LOAD Text(ID) as ID, Text INLINE [
ID, Text
2, Text1
02, Text2
002, Text3
0002, Text4
];
LET vTest1 = applymap('MT', 2, 'NotFound');
LET vTest2 = applymap('MT', '02', 'NotFound');
LET vTest3 = applymap('MT', text('002'), 'NotFound');
to get this result
Peter
[Edit] Attached the example document to further play with.