Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi there,
I would like to remane some records in a field that's why I used MAPPING function. I put that script just before to load the concerned table.
MAPPING:
MAPPING LOAD * inline [
Old ,New
"char 1", "new char 1"
"char 2", "new char 2"];
map
[fieldName] using MAPPING;But nothing happened..
Any ideas?
Thank you.
aquakee,
Try applying the map inline like so:
applymap('MAPPING',[repartition_arrete...]) as [repartition_arrete...]
This should work. I am not sure why the other way does not work.
EDIT: I think it doesn't work because you are loading from a QVD. I wouldn't expect this behavior, but I was able to duplicate it on my machine. When using an Inline table to test instead of a QVD, the "map x using y;" syntax worked fine. It did not work when I tried it with a QVD load.
EDIT2: The source of the error is because when you load directly from the QVD, it performs an optimized load. This will not use the mappings that you have defined. If you want to still use your source QVDs with the original mapping syntax you wrote, you can de-optimize the QVD load. One way to do this is to add a where clause such as:
Load *
From
file.qvd
(qvd) WHERE 1=1;
Speros
Is your "map X using Y;" statement before your load statement where you load the fieldName values?
I put my whole script before this load.
LOAD
IDF,
COD_,
fieldName
FROM
(
Can you provide a sample of the actual code that does not work?
I've tested the syntax the way you've detailed it with some random data. It works fine. Maybe you have a typo somewhere?
MAPPING:
MAPPING LOAD * inline [
Old ,New
"3 à 6 mois", "de 3 à 6 mois"];
map [ repartition_arrete_tranche_duree_annuel] using MAPPING;
LOAD
IDF_AGENT,
repartition_arrete_tranche_duree_annuel
FROM
Thank you Speros
It looks like you have an extra space here: map [ repartition_arrete_tranche_duree_annuel] using MAPPING;
Should it say [repartition...] instead of [ repartition...]?
I corrected but it doesn't work..
Can you clarify how it doesn't work? Does the reload finish? Does the repartition field exist in the resulting data model? Is it populated with the old values?
The reload finishes, the field exists and it is populated with the old values but the name of the record is still the old one.. It doesn't take the new name..
aquakee,
Try applying the map inline like so:
applymap('MAPPING',[repartition_arrete...]) as [repartition_arrete...]
This should work. I am not sure why the other way does not work.
EDIT: I think it doesn't work because you are loading from a QVD. I wouldn't expect this behavior, but I was able to duplicate it on my machine. When using an Inline table to test instead of a QVD, the "map x using y;" syntax worked fine. It did not work when I tried it with a QVD load.
EDIT2: The source of the error is because when you load directly from the QVD, it performs an optimized load. This will not use the mappings that you have defined. If you want to still use your source QVDs with the original mapping syntax you wrote, you can de-optimize the QVD load. One way to do this is to add a where clause such as:
Load *
From
file.qvd
(qvd) WHERE 1=1;
Speros