Skip to main content

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
CUSTOMERS ONLY: Now accepting customer applications for the 2023 Luminary Program: SUBMIT NOW
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 - Specialist
Partner - Specialist


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
bill_markham
Champion III
Champion III

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.
If you want to go quickly, go alone. If you want to go far, go together.
fred_s
Partner - Specialist
Partner - Specialist


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