Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

ApplyMap with LOAD INLINE not working

Hi folks,

Usually I don't struggle with the ApplyMap function, has been working great.  However, when I try to use it with an INLINE lookup such as the example below, it will not map to AAContactNoDesc.  Am I doing something wrong here?

MAP_AACONTACTNO:

MAPPING LOAD * INLINE

[AAContactNumber, AAContactNoDesc

'0113 438 0120','Flying to Mars'

'0330 780 7436','Flying to the Moon'];

LOAD Letter_code,  

     DELIVERY_NNA,  

     ApplyMap('MAP_AACONTACTNO',AAContactNumber) as AAContactNoDesc,  

     LoadedDate

FROM [\\abcdef.qvd] (qvd);

Many thanks, Alex

31 Replies
tobias_klett
Partner - Creator II
Partner - Creator II

Hi, to check it load without "Mapping" and put all the Fields into a table box...

sunilkumarqv
Specialist II
Specialist II

is there mapping field  AAContactNumber in the second table if so then it work


MAP_AACONTACTNO:

MAPPING LOAD * INLINE

[AAContactNumber, AAContactNoDesc

'0113 438 0120','Flying to Mars'

'0330 780 7436','Flying to the Moon'];

LOAD Letter_code, 

     DELIVERY_NNA,

    AAContactNumber  /*  check the field is there or not */

     ApplyMap('MAP_AACONTACTNO',AAContactNumber) as AAContactNoDesc, 

     LoadedDate

FROM [\\abcdef.qvd] (qvd);

sasiparupudi1
Master III
Master III

May be there are spaces in your source string.. try trimming it, also please check if the source strings match to the strings in the mappping load.

MAP_AACONTACTNO:

MAPPING LOAD * INLINE

[AAContactNumber, AAContactNoDesc

'0113 438 0120','Flying to Mars'

'0330 780 7436','Flying to the Moon'];

LOAD Letter_code,  

     DELIVERY_NNA,  

     ApplyMap('MAP_AACONTACTNO',Trim(AAContactNumber)) as AAContactNoDesc,  

     LoadedDate

FROM [\\abcdef.qvd] (qvd);

hth

Sasi

Not applicable
Author

Hi Tobias,

Yes, it seems that QV is loading the data differently.

Any ideas how to get ensure they both the same. I presume the box on the left is a number and on the right it is text?  Is that right?

ApplyMap.jpg

Not applicable
Author

The field is there, but as per my response to Tobias, it looks like the data types are being loaded differently.

Not applicable
Author

Thanks Sasi, I tried trim(text(x)) to no avail.

sasiparupudi1
Master III
Master III

may be try

ApplyMap('MAP_AACONTACTNO',Text(Trim(AAContactNumber))),'NA') as AAContactNoDesc, 

sunny_talwar

May be try forcing Text to both of them?

MAP_AACONTACTNO:

MAPPING LOAD Text(AAContactNumber) as AAContactNumber,

                          AAContactNoDesc

INLINE [

AAContactNumber, AAContactNoDesc

0113 438 0120, Flying to Mars

0330 780 7436, Flying to the Moon

];

LOAD Letter_code, 

     DELIVERY_NNA, 

     ApplyMap('MAP_AACONTACTNO', Text(AAContactNumber)) as AAContactNoDesc, 

     LoadedDate

FROM [\\abcdef.qvd] (qvd);

Not applicable
Author

Thanks Sunny, tried that and still no joy.

sasiparupudi1
Master III
Master III

Please could you provide sample data?