Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
Can you pleae help me to get Label names from second table to replace IDs in the first table.
Source :
Name | ID | CID | ZID |
Arunesh | 1001 | 2001 | 3001 |
Ramesh | 2001 | 3001 | 40001 |
Nancy | 5001 | 7001 | 6001 |
Map of label:
Field | Label |
ID | ScreenId |
CID | CountryId |
ZID | ZoneID |
output:
Name | ScreenId | CountryId | ZoneID |
Arunesh | 1001 | 2001 | 3001 |
Ramesh | 2001 | 3001 | 40001 |
Nancy | 5001 | 7001 | 6001 |
I am having too many colums so lookng some some automated way in the script.
Thanks in advance!
Best Regards,
Arunesh
// Load the source table
LOAD * from source...;
// Load the fieldname mapping table
FieldMap:
Mapping LOAD Field, Label from mapping_source_file...;
// Rename existing fields using the Map
Rename Fields Using FieldMap;
-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com
The solution provided by @rwunderlich should work. Just a tiny adjustment. It's missing the mapping declaration that defines the table a mapping table.
// Load the source table
LOAD * from source...;
// Load the fieldname mapping table
FieldMap:
MAPPING LOAD Field, Label from mapping_source_file...;
// Rename existing fields using the Map
Rename Fields Using FieldMap;
// Load the source table
LOAD * from source...;
// Load the fieldname mapping table
FieldMap:
Mapping LOAD Field, Label from mapping_source_file...;
// Rename existing fields using the Map
Rename Fields Using FieldMap;
-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com
The solution provided by @rwunderlich should work. Just a tiny adjustment. It's missing the mapping declaration that defines the table a mapping table.
// Load the source table
LOAD * from source...;
// Load the fieldname mapping table
FieldMap:
MAPPING LOAD Field, Label from mapping_source_file...;
// Rename existing fields using the Map
Rename Fields Using FieldMap;
Thanks for that edit!
-Rob
Thank you!