Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

praveenavelagap
Contributor III

mapping load

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?

1 Solution

Accepted Solutions

Re: mapping load

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

Mapping Load thread237296 .jpg

Peter

[Edit] Attached the example document to further play with.

4 Replies

Re: mapping load

May be load ID field in the mapping table using Text() function:

MappingTable:

Mapping

LOAD Text(ID) as ID,

          Text

FROM....

Re: mapping load

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.

Re: mapping load

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

Re: mapping load

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

Mapping Load thread237296 .jpg

Peter

[Edit] Attached the example document to further play with.

Community Browser