Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
tbrevignon
Contributor
Contributor

Applymap issue

Hello all,

I have some questions concerning ApplyMap.

I am currently using an excel file loaded to fill the table of mapping.

The loading is as followed

MAP_MVT:
Mapping LOAD
Code as [Code mouvement],
Type_Mouvement
FROM [lib://DATA - Commun:DataFiles/Mapping_Mvt.xlsx]
(ooxml, embedded labels, table is GRP);

Later, I want to use it to add a new field:

MSEG:
LOAD
// KDAUF_KDPOS,
// MBLNR_MJAHR,
// "TVA non déductible",
// Action,
// "Adapt. qté crs poste",
// "Ann.EM malgré EF",
// "Article NPF",
// "Article cible",
// "Article cible 1",
[Article], // OK - 5
// "Art.géré en stk",
// "Alt. base amount",
// "Boîte de dialogue oui/non",
// "Code : valor. stock sous-tr.",
// "Code de mise à dispo",
// "Code origine mvmt.",
// "Commande d'achat",
// "Commande automatique",
// "Commande client",
// "Commande client 1",
// "Chaîne de valeur",
// "Chaîne de qté",
// "Clé d'état",
// "Clé condition",
// "Clé condition 1",
// "Clé objet immobilier",
// "Clé état lot transf.",
// Client,
[Code débit/crédit], // OK - 8
[Code mouvement], // OK - 4
ApplyMap('MAP_MVT', [Code mouvement], 'Pas de mapping') as Type_MVT,

..

It is not working however.

The field in the table loaded is defined as a 3 character long.

The field in the excel file is defined as text.

Do you have an idea on how to solve it ?

Here are the screenshot of the file loaded and the result.

Thanks you for your answers.

Thomas.

Labels (1)
1 Solution

Accepted Solutions
BrunPierre
Partner - Master
Partner - Master

Use Trim() as there may be leading and trailing spaces.

View solution in original post

3 Replies
BrunPierre
Partner - Master
Partner - Master

Use Trim() as there may be leading and trailing spaces.

tbrevignon
Contributor
Contributor
Author

Thank you for your answer. I have added the Trim as followed 

tbrevignon_0-1711102123529.png

But also during the call of the applymap

tbrevignon_1-1711102471015.png

And it worked ! 

tbrevignon_2-1711102504763.png

 

Thank you for the advice.

Manojkumar_250830
Contributor II
Contributor II

@tbrevigno : Change ApplyMap syntax

ApplyMap('MAP_MVT', [Code mouvement], 'Pas de mapping') as Type_Mouvement