Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
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

Re: Simple applymap() not working

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
3 Replies

Re: Simple applymap() not working

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
Valued Contributor II

Re: Simple applymap() not working

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

Re: Simple applymap() not working

Gysbert,

I said it was simple....

I have wasted half an hour on that.

Thanks very much

Jason

Community Browser