Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Highlighted
Metalix64
New Contributor

Why my Applymap return key value ?

Hi there,

I have a problem with my function ApplyMap();

My mapping loads well but when I want to use the function ApplyMap, it returns me the value of the key and not its corresponding value. See the example below :

My Mapping table :

image.png

My other table from QVD file:

image.png

My code :

Mapping:
MAPPING LOAD Distinct
    code,
    family
FROM [lib://PATH\Mapping.xlsx]
(ooxml, embedded labels, table is FPY);

FPY2:
LOAD
    *
FROM [lib://PATH/PROD0145.QVD]
(qvd);

FPY_MAP :
LOAD *,
ApplyMap('Mapping',code) as Mapping
Resident FPY2;

STORE FPY_MAP INTO [lib://PATH/MAPPING_TEST.csv] (txt);

Labels (2)
1 Solution

Accepted Solutions
Somasundaram
Contributor III

Re: Why my Applymap return key value ?

Hi,

 

It seems your mapping table 'code' format is different from fact table.

Please check and change the correct format.

 


-Somasundaram
2 Replies
Somasundaram
Contributor III

Re: Why my Applymap return key value ?

Hi,

 

It seems your mapping table 'code' format is different from fact table.

Please check and change the correct format.

 


-Somasundaram
Metalix64
New Contributor

Re: Why my Applymap return key value ?

Hi,

Thank you for your answer, indeed I force the type of my field with the function text () and it works now.

My new code :

Mapping:
MAPPING LOAD Distinct
    text(code) as newcode,
    family
FROM [lib://PATH\Mapping.xlsx]
(ooxml, embedded labels, table is FPY);

FPY2:
LOAD

 text(AGENT) as newcode,
    *
FROM [lib://PATH/PROD0145.QVD]
(qvd);

FPY_MAP :
LOAD *,
ApplyMap('Mapping',text(newcode)) as Mapping
Resident FPY2;

 

Thx.