Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
Hi, to check it load without "Mapping" and put all the Fields into a table box...
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);
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
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?
The field is there, but as per my response to Tobias, it looks like the data types are being loaded differently.
Thanks Sasi, I tried trim(text(x)) to no avail.
may be try
ApplyMap('MAP_AACONTACTNO',Text(Trim(AAContactNumber))),'NA') as AAContactNoDesc,
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);
Thanks Sunny, tried that and still no joy.
Please could you provide sample data?