Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
surajap123
Creator II
Creator II

Applymap() scenarios

Hi Experts,

I think I know the use of Applymap(), It is used to lookup the date in the mapping table and load into the main table.

I have read a statement that "Applymap() is used to cleanup the data model in Qlikview". I dont understand how Applymap help in to cleanup the data.

1.Could you please help me with an example?

2.What are the general requirements we get to use applymap in your scrips? Please give few examples.

Regards,

Suraj

1 Solution

Accepted Solutions
fred_s
Partner - Creator III
Partner - Creator III


Applymap helps cleaning up the data model by dropping the table used for mapping.
This means that after the mapping, there's only one table left instead of two connected tables.

Without mapping:

without-applymap-script.JPG.jpg

without-applymap.JPG.jpg

And now the same with Mapping:

Applymap.JPG.jpg

after-applymap.JPG.jpg

View solution in original post

5 Replies
Anonymous
Not applicable

Suraj

Does this sample script and attached qvw help explain ?

This could have been done without the applymap() but then you would have had 2 joined tables in your data model, MapColour and Box joined with ColourID.

Having used the applymap() you just have one table and you can also drop the field ColourID.

MapColour:

Mapping LOAD * INLINE [

    ColourID, Colour,

    1, Red

    2, Blue

    3, Green

]

;

Box:

LOAD * INLINE [

    Box, ColourID

    Big, 1

    Small, 2

    Medium, 1

    Squashed ,3

    Tiny , 2

];

BoxWithColour :

load

  applymap ( 'MapColour', ColourID ) as BoxColour ,

  Box

resident Box

;

drop table Box ;

Best Regards,     Bill

vikasmahajan

See Demo Attached with simple example

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
fred_s
Partner - Creator III
Partner - Creator III


Applymap helps cleaning up the data model by dropping the table used for mapping.
This means that after the mapping, there's only one table left instead of two connected tables.

Without mapping:

without-applymap-script.JPG.jpg

without-applymap.JPG.jpg

And now the same with Mapping:

Applymap.JPG.jpg

after-applymap.JPG.jpg

Not applicable

Excellent.

ngulliver
Partner - Specialist III
Partner - Specialist III

Hi, Suraj.

I recommend looking at Steve Dark's blog on using ApplyMap:

http://www.quickintelligence.co.uk/applymap-is-it-so-wrong/

Regards,

Neil