Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Announcements
Announcing the newest addition to the Qlik Community, Qlik Gallery! Learn More
Not applicable

Nested Apply Map with If()

Hi,

I have a scenario with nested ApplyMap(), something like;

               Temp_1:

               Mapping Load

               A,

               A_Fetch

               resident Temp;

               Temp_2:

               Mapping Load

               B,

               B_Fetch

               resident Temp;

                                        ...and so on...

               Tab:

               ...

               ApplyMap('Temp1',A1,AppyMap('Temp2',B2, ..)) as New_Field

               ....

Now a field 'New_Field', resultant of  nested ApplyMap() should be created with the logic that

if A_Fetch is NotNull Then A_Fetch values will be taken

and if A_Fetch ISNull Then Go to next ApplyMap of Temp2..Check the same and so on..

Please help in this...

Thanks in advance !

Tags (1)
2 Replies
rajeshvaswani77
Valued Contributor III

Re: Nested Apply Map with If()

if(not(isnull(ApplyMap('Temp1',A1)),ApplyMap('Temp1',A1),if(not(isnull(ApplyMap('Temp2',A1)),ApplyMap('Temp2',A1)))

thanks,

Rajesh Vaswani

Not applicable

Re: Nested Apply Map with If()

Morning,

I have just used something similar yesterday. I used the following in my script:

ApplyMap('MAP_CUST_INV',

  COMPANY & '-' &

  REFERENCE_NUMBER,

  ApplyMap('MAP_SUP_INV',

  COMPANY & '-' &

  REFERENCE_NUMBER,

  Null())) as [%Ref Key],

As far as I know this automatically takes into account the null values. If the first map results in a null() it will use the second map, if the second map results in a null it will just return null in this case but you could just as easily put more maps in there.

Andy