Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
chimiralavenkatesulu
Contributor
Contributor

Applymap() duplication

Hi Every one, 

 

is 

is applymap() allowing duplicates? why? what is the final result?  can any one answer me please

 

Labels (1)
3 Replies
Daniel_Castella
Support
Support

Hi @chimiralavenkatesulu 

 

Could you, please, provide more information about your issue or an example? You can load the mapping using distinct function to not allow duplicates. However, I think that, when doing the applymap it will depend on the table you are doing it. I mean, if that table has duplicates, the applymap will be duplicated too.

 

Kind Regards

Daniel

Lech_Miszkiewicz
Partner Ambassador/MVP
Partner Ambassador/MVP

applymap does not create duplicates however it allows map table to contain duplicates. It picks first value from the mapping table which matches the map. 

so assuming you have mapping tables like below 

map_from, map_to

a, 1

a, 2

the result of mapping value a will be 1 as that is the first value in mapping table. 

You may also think about applymap as of vlookup equivalent.

cheers

cheers Lech, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful to the problem.
Nagaraju_KCS
Specialist III
Specialist III

 

Mapping load is Row-by-Row Execution , when the main table is loaded, Qlik checks the mapping table for every single row. If the key field in your main table is 'A',

ApplyMap() finds the corresponding value in the map table and returns it.

If mapping table duplicate values for ID, data returns only for first value.

example:
ID, to_map
100, A
100, B

the result of mapping value will be A. (if it is first record B the result of mapping value will B)