Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All
I try to learn how to apply mapping .
May i know why cannot add MAPPING in below script ?
MAP:
//MAPPING
LOAD
SEG_RAW,
SEGMENT
FROM
C:\Users\pauly\Dropbox\mainqv\QV_PROJECT\MAPPING\MAPPAY.xlsx
(ooxml, embedded labels, table is ADL);
PAY:
LOAD
UserField1,
ApplyMap('Map_PAY',[UserField1],'OTHERS') as [SEGMENT_]
FROM
C:\Users\pauly\Dropbox\mainqv\QV_PROJECT\MAPPING\PAY_ADL.csv
(txt, codepage is 1252, embedded labels, delimiter is ',', msq);
Paul
Hi,
All you have to do is add the "mapping" keyword before the load statement.
Now two things to remember about the mapping table.
1. It should have exactly 2 columns.
2. The first column should be the column for which you want to change the new value.
and the second column should represent your new value.
In your case the mapping table script will be as below.
MAP:
MAPPING
LOAD
SEG_RAW,
SEGMENT
FROM
C:\Users\pauly\Dropbox\mainqv\QV_PROJECT\MAPPING\MAPPAY.xlsx
(ooxml, embedded labels, table is ADL);
Hi Paul,
You must define the table as a mapping table if you want to use the Apply map function.
If you do not define a mapping table, your Apply map function won't work.
Hi Kau
Thank you for your sharing. Can you share how to define the table as Mapping table ?
Paul Yeo
Hi,
All you have to do is add the "mapping" keyword before the load statement.
Now two things to remember about the mapping table.
1. It should have exactly 2 columns.
2. The first column should be the column for which you want to change the new value.
and the second column should represent your new value.
In your case the mapping table script will be as below.
MAP:
MAPPING
LOAD
SEG_RAW,
SEGMENT
FROM
C:\Users\pauly\Dropbox\mainqv\QV_PROJECT\MAPPING\MAPPAY.xlsx
(ooxml, embedded labels, table is ADL);
Hi Sir
I have define a mapping table , and also link the mapping table field i need to map UserField1 with my load script , still not working.
Map_Pay:
MAPPING
LOAD
UserField1,
SEGMENT
FROM
C:MAPPAY.xlsx
(ooxml, embedded labels, table is ADL);
PAY:
LOAD
UserField1,
ApplyMap('Map_PAY',[UserField1],'OTHERS') as [SEGMENT_]
FROM
C:PAY_ADL.csv
(txt, codepage is 1252, embedded labels, delimiter is ',', msq);
Paul
I don't see any error in the script.
What is the error that you get?
Can you share the data to recreate your issue on my environment?
Hi Sir
I don't get any error msg. just that it cannot recode .
enclosed my raw data.
Paul
Hi,
It didnt work because the Mapping table name that you were supplying in Applymap Function was wrong.
It should have been "Map_Pay" but you have used "Map_PAY".
Thus it didnt find the Mapping table and thus it didnt work.
Try with the exact mapping table name and it should work.
Hi Sir
I hv try to make both Map_Pay the same , but it still cannot work.
Any other suggestion ?
Paul
Hi Sir
I just test when i comment Mapping it work fine.
where go wrong ?
Paul