Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi there,
I have a problem with my function ApplyMap();
My mapping loads well but when I want to use the function ApplyMap, it returns me the value of the key and not its corresponding value. See the example below :
My Mapping table :
My other table from QVD file:
My code :
Mapping:
MAPPING LOAD Distinct
code,
family
FROM [lib://PATH\Mapping.xlsx]
(ooxml, embedded labels, table is FPY);
FPY2:
LOAD
*
FROM [lib://PATH/PROD0145.QVD]
(qvd);
FPY_MAP :
LOAD *,
ApplyMap('Mapping',code) as Mapping
Resident FPY2;
STORE FPY_MAP INTO [lib://PATH/MAPPING_TEST.csv] (txt);
Hi,
It seems your mapping table 'code' format is different from fact table.
Please check and change the correct format.
Hi,
It seems your mapping table 'code' format is different from fact table.
Please check and change the correct format.
Hi,
Thank you for your answer, indeed I force the type of my field with the function text () and it works now.
My new code :
Mapping:
MAPPING LOAD Distinct
text(code) as newcode,
family
FROM [lib://PATH\Mapping.xlsx]
(ooxml, embedded labels, table is FPY);
FPY2:
LOAD
text(AGENT) as newcode,
*
FROM [lib://PATH/PROD0145.QVD]
(qvd);
FPY_MAP :
LOAD *,
ApplyMap('Mapping',text(newcode)) as Mapping
Resident FPY2;
Thx.