Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have a table and I want Zenith and Zain in the table below load as ZN. how do I load this table. note that the table is incremental new data and new name are coming.
load * inline[
A, B, C
1, Zenith, 23
2, ECO, 40
3. UBA, 56
4.OCHE, 29
5. YYY, 67
6.RRR, 21
7.Zain, 56
]
Good morning,
Please find attached the working file. You had 2 issues in your script; a datapath that was undefined at the start, and the correct variable not being used in the applymap function.
Kind regards,
Johan
Hi,
Probably easiest would be to work with a mapping load for those 2 names (you can extend it later to other names as well).
Map_ZN
MAPPING Load * inline [
Name, Newname
Zenith, ZN
Zain, ZN ]
And then finish with a maping load on the B-variable on the data that you add.
Applymap ('Map_ZN', B) as B
am loading from excel and I have to load all the data not only Zenith and Zain
Of course you do. But your initial question was to rename Zenith and Zain into ZN...
Can you attach your script?
Do as Johan mentions but use this instead:
Applymap ('Map_ZN', B,B) as B
Its same question not changing the topic. Am loading a set of data from a table and I want to rename two different data into 1, that is why I said the table is incremental
Hello,
I'm not discussing linguistic issues. I'm just trying to help. Now, if you could upload your script, then I can help you 10x faster than right now.
I don't understand you, am loading from QVD . just gave you a scenario
Hi Christopher,
You do not need to have B,B in your apply map expression.
If the mapping fails to find a match the original value is returned unless a default value is included.
So Applymap ('Map_ZN', B) as B will return either the mapped value or the data in B
Try something like this. The mapping table will be automatically deleted on completion of the load.
Name_Map:
MAPPING Load * inline [
Name, New
Zenith, ZN
Zain, ZN
] ;
Load
A,
Applymap('Name_Map', B) as B,
C
from your_qvd_file.qvd (qvd) ;