Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi! 🙂
I have a question .. i have a table with about 15 columns with specific column names.
What i want is, that trough a lookup (an excel or something else) i want to set the names of the columns in QlikView, for example:
In the table with 15 columns there is a name like: LoadDate ..
In the other table (Lookup) i make a matching -> when the columname is LoadDate, i want to set the column name in QlikView Loading Date.
In the script i load both tables .. but now i dont know how i can set the name as in the lookup table, when i make for example a table and set LoadDate as a Dimension.
How is it possible to make this?
I hope you can understand what i want 😄
When you load your lookup table you have to insert the prefix "Mapping" before the LOAD statement:
DetailsTable: LOAD Stand, LoadDate, Columnname, StorageName FROM [..\QvdGenerator\qvd\Details.qvd] (qvd); MatchingName: Mapping LOAD rootName , QvName FROM [..\QvdGenerator\qvd\MatchingNameqvd] (qvd); RENAME Fields using MatchingName;
Jaime.
Hi! Please, try something like the following in your script:
//Your data table LOAD * Inline [ Column1, Col2, Column3, Col4 ]; //Your "LookUp" table MAP_ColNames: Mapping LOAD * Inline [ PreviousName, NewName Column1, NewColumn1 Col2, NewColumn2 Col4, NewColumn3 ]; //Rename RENAME Fields using MAP_ColNames;
Hope it helps!
Bests,
Jaime.
Hi, thank you for your response.
In my Lookup table i have to columns .. rootName and QvName .. than i have values where i already do the matching.
Now when i do the rename it says; Table not found error .. but i have this table.
DetailsTable:
LOAD Stand,
LoadDate,
Columnname,
StorageName
FROM
[..\QvdGenerator\qvd\Details.qvd]
(qvd);
MatchingName:
LOAD rootName ,
QvName
FROM
[..\QvdGenerator\qvd\MatchingNameqvd]
(qvd);
RENAME Fields using MatchingName;
When you load your lookup table you have to insert the prefix "Mapping" before the LOAD statement:
DetailsTable: LOAD Stand, LoadDate, Columnname, StorageName FROM [..\QvdGenerator\qvd\Details.qvd] (qvd); MatchingName: Mapping LOAD rootName , QvName FROM [..\QvdGenerator\qvd\MatchingNameqvd] (qvd); RENAME Fields using MatchingName;
Jaime.
Thank you! It works! 🙂
You are welcome! 🙂