Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
Highlighted
Not applicable

Applymap And mapping update Question

Hi all,

Map_Name:

Mapping

Load * Inline [

ID, Name

  1, ABC

  2,XYZ

];

Tab:

ID,

Field1,

Field2,

Applymap('Map_Name',ID,ID) as proname

FROM Tab;

Here it will return Name if ID Exist in Mapping Table.

Suppose If i pass ID as 3 Which i dont have the Mapping Table, what it will return??

Please help me out this issue...

Thanks in advance.

regards

Prathap

4 Replies
Highlighted
t_chetirbok
Valued Contributor

Re: Applymap And mapping update Question

Hello!

When you pass ID as 3,your new field will be 3 like ID

Map_Name:

Mapping

Load * Inline [

ID, Name

  1, ABC

  2,XYZ

];

Tab:

load

ID,

Field1,

Field2,

Applymap('Map_Name',ID,ID) as proname

;

load * Inline

[

ID,Field1,Field2,

1, A,B

2,C,D

3,E,F

]

;

Highlighted
Digvijay_Singh
Honored Contributor III

Re: Applymap And mapping update Question

The third parameter in Applymap('Map_Name',ID,ID) is the value returned when it doesn't match with the mapping table. Normally we use 'Not available', 'NA' to indicate the missing value but it can be set as per the need.. Thanks.

Highlighted

Re: Applymap And mapping update Question

You do not need to add ID as a third parameter, applymap will use the source field by default if no match is found and the 3rd parameter is not present,

Try

      Applymap('Map_Name',ID) as proname,

      Applymap('Map_Name',ID, 'Unknown') as proname2,

to see how to use the third parameter in applymap.

Highlighted

Re: Applymap And mapping update Question

Hi Prathap,

In the applymap function if you don't find the matching ID then we have the option to specific what you need to show in such case

Applymap('Map_Name',ID) as proname, if nothing is specified it will return the ID

Applymap('Map_Name',ID,null()) as proname, if ID is missing in mapping table ,this will give null

Applymap('Map_Name',ID,'ID Missing') as proname, this will give a text as ID Missing