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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Simple applymap() not working

I want to use applymap but I cannot get it to work. I have tried executing a simple example so i could then apply that to what I need but I can't get the simple example to work! :

Table importing from Excel:

%KeyColour
11
22
31

Code in script:

Table1:

LOAD *,

     ApplyMap('ColourDesc',Colour, 'Unknown')as AColour;

LOAD %Key,

     Colour

FROM

C:\Users\Documents\Qlikview\Demo.xls

(biff, embedded labels, table is Sheet1$);

  

ColourDesc:

MAPPING

LOAD

          Colour,

          CDescription

INLINE [

Colour, CDescription

1,Red

2,Blue

];

To me it looks the same as all the examples I have looked at but it doesn't want to work as the description is not assigned to AColour

Any help?

Regards

Jason

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Load the mapping table first

ColourDesc:

MAPPING

LOAD * INLINE [

Colour, CDescription

1,Red

2,Blue

];

Table1:

LOAD *,

     ApplyMap('ColourDesc',Colour, 'Unknown') as AColour;

LOAD %Key,

     Colour

FROM

C:\Users\Documents\Qlikview\Demo.xls

(biff, embedded labels, table is Sheet1$);


talk is cheap, supply exceeds demand

View solution in original post

3 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Load the mapping table first

ColourDesc:

MAPPING

LOAD * INLINE [

Colour, CDescription

1,Red

2,Blue

];

Table1:

LOAD *,

     ApplyMap('ColourDesc',Colour, 'Unknown') as AColour;

LOAD %Key,

     Colour

FROM

C:\Users\Documents\Qlikview\Demo.xls

(biff, embedded labels, table is Sheet1$);


talk is cheap, supply exceeds demand
shree909
Partner - Specialist II
Partner - Specialist II

Hi ,

first u need to have mapping table then u should have the  actual code for calculation

ColourDesc:

MAPPING

LOAD

          Colour,

          CDescription

INLINE [

Colour, CDescription

1,Red

2,Blue

];

Code in script:

Table1:

LOAD *,

     ApplyMap('ColourDesc',Colour, 'Unknown')as AColour;

     Colour

FROM

C:\Users\Documents\Qlikview\Demo.xls

(biff, embedded labels, table is Sheet1$);

Not applicable
Author

Gysbert,

I said it was simple....

I have wasted half an hour on that.

Thanks very much

Jason