Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Experts,
i have the following script.
MapTable:
Mapping LOAD * INLINE [
OLD, NEW
0831, 0201
0208, 0214
0210, 0212
];
Branch:
LOAD
Applymap('MapTable', BRCODE, BRCODE) as BRCODE,
BRNAME,
FROM
QVD\BRANCH.qvd
(qvd);
Calls:
LOAD Applymap('MapTable', BRCODE, BRCODE) as BRCODE ,
Date,
BRNAME,
Answered
FROM
QVD\DATA.qvd
(qvd);
concatenate
LOAD Date,
BRNAME,
Lookup('BRCODE','BRNAME', BRNAME,'Calls') as BRCODE,
Answered
FROM
QVD\CallDetails.qvd
(qvd)
Sales:
LOAD Date,
Amount,
Applymap('MapTable', BRCODE, BRCODE) as BRCODE
FROM
QVD\Sales.qvd
(qvd);
I want to do mapping on BRCODE for all the above tables.
the applymap does works on all tables except Calls table.
the Calls table (after concatenate) doesn't have BRCODE, so i have done a lookup with the other table.
Now, i have to use applymap for Calls table (after concatenate).
How can i do this...pls help....
Try this:
concatenate
LOAD Date,
BRNAME,
applymap('MapTable',Lookup('BRCODE','BRNAME', BRNAME,'Calls')) as BRCODE,
Answered
FROM
QVD\CallDetails.qvd
(qvd)
You can either pipe your Lookup() into an Applymap(), like:
Concatenate
LOAD
Applymap('MapTable', BRCODE, BRCODE) as BRCODE,
Date,
BRNAME,
Answered;
LOAD
Date,
BRNAME,
Lookup('BRCODE','BRNAME', BRNAME,'Calls') as BRCODE,
Answered
FROM QVD\CallDetails.qvd (qvd)
Or you can skip all your Applymap() calls and instead use
Map BRCODE Using MapTable;
right after you load the mapping table.
HIC
Gysbert,
Thanks for the response.
but still its not working with calls table
thanks henric,
i tried like this,
MapTable:
Mapping LOAD * INLINE [
OLD, NEW
0831, 0201
0208, 0214
0210, 0212
];
MAP BRCODE Using MapTable;
Branch:
LOAD
BRCODE ,
BRNAME
FROM
QVD\BRANCH.qvd
(qvd);
Calls:
LOAD BRCODE,
Date,
BRNAME
Answered
FROM
QVD\DATA.qvd
(qvd);
concatenate
LOAD Date,
BRNAME,
Lookup('BRCODE','BRNAME', BRNAME,'Calls') as BRCODE,
Answered
FROM
QVD\CallDetails.qvd
(qvd);
Sales:
LOAD Date,
Amount,
ORDTYPE,
BRCODE
FROM
QVD\Sales.qvd
(qvd);
but still mapping is not done.
Can you pls help me with the script
Without the qvw, it is impossible to say what goes wrong. But I have a suspicion that it is something with the number formats of the values that makes them not getting recognized...
Try testing a mapping table like:
MapTable:
Mapping LOAD 'X' & OLD as OLD, NEW INLINE [
OLD, NEW
...
and the corresponding change when you create the BRCODE:
'X' & BRCODE as BRCODE,
Then you can better see the values of BRCODE and why they don't match.
HIC
Henric,
Should i try like this..?
MapTable:
Mapping LOAD 'X' & OLD as OLD, NEW INLINE [
OLD, NEW
0831, 0201
0208, 0214
0210, 0212
];
MAP 'X' & 'BRCODE' as BRCODE Using MapTable;
pls help
help me out plsss
The Mapping Load looks OK.
The Map statement should not be changed. It should be like this:
MAP BRCODE Using MapTable;
The Load statements where you load BRCODE should be changed:
Load
...
'X' & BRCODE as BRCODE,
...
HIC
Henric,
i have done like this
MapTable:
Mapping LOAD 'X' & OLD as OLD, NEW INLINE [
OLD, NEW
0831, 0201
0208, 0214
0210, 0212
];
MAP BRCODE Using MapTable;
Branch:
LOAD 'X' & BRCODE as BRCODE ,
BRNAME
FROM
QVD\BRANCH.qvd
(qvd);
Calls:
LOAD 'X' & BRCODE as BRCODE,
Date,
BRNAME,
Answered,
Unanswered,
Outgoing
FROM
QVD\DATA.qvd
(qvd);
Now all the BRCODE has changed to code with prefix X like X0021 which is not correct.
Normal applymap is working for all tables except the part highlighted in bold red.
pls help me with some solution for that part