Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
gf
Contributor II

ApplyMap doesn't use default mapping

Hello all,

My ApplyMap which looks like this: 

ApplyMap('T1',LANDISO & BLTSPRISO & BLTGS1,'AT' & 'DEAT' & BLTGS1) as TextG1

doesn't work as expected.

For values where LANDISO and BLTSPRISO and BLTGS1 are in my Mapping table it works fine but if the value isn't in my mapping table, T1 should map on  'AT' & 'DEAT' & BLTGS1 which doesn't work..

Any ideas?

 

Regards, Gf

1 Solution

Accepted Solutions
MVP
MVP

Re: ApplyMap doesn't use default mapping

>>but if the value isn't in my mapping table, T1 should map on...

I think you may be misunderstanding the third parameter of ApplyMap(). It is simply a value that is returned if there is no match in the mapping table. To map a different value, you could use this:

 

ApplyMap('T1', LANDISO & BLTSPRISO & BLTGS1, 
    ApplyMap('T1', 'AT' & 'DEAT' & BLTGS1, 'No Match')) as TextG1

 

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
3 Replies
Employee
Employee

Re: ApplyMap doesn't use default mapping

Can you show your script ?
Nishanthi
New Contributor II

Re: ApplyMap doesn't use default mapping

Hi, BLTGSI hope it is a field.... So if none maps in your situations then it goes to this expression,
" 'AT' & 'DEAT' & BLTGS1 ". But here if you look at it, it doesn't know internally which value of it to concatenate. For example , BLTGS1 contains A1,B2,B4,Y6 then from your expression point of view,
ATDEAT___ which value should be replaced. So try giving any other alternative.
MVP
MVP

Re: ApplyMap doesn't use default mapping

>>but if the value isn't in my mapping table, T1 should map on...

I think you may be misunderstanding the third parameter of ApplyMap(). It is simply a value that is returned if there is no match in the mapping table. To map a different value, you could use this:

 

ApplyMap('T1', LANDISO & BLTSPRISO & BLTGS1, 
    ApplyMap('T1', 'AT' & 'DEAT' & BLTGS1, 'No Match')) as TextG1

 

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein