Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello all -
Thanks ahead for this excellent community of users, one of the reasons we recently purchased QlikView. We have many tables with very strange names and instead of renaming them all in the script, we would like to maintain a list of metanames and load the meta names instead of the field names. And of course eventually the definition of the field from the data dictionary. I sure hope we aren't the first to encounter this, but I sure couldn't find any posts. Here is our example:
Data file:
EMAIL_ADDRESS | FIRST_NAME | LAST_NAME |
thekelleykid@yahoo.com | Kim | Kelley |
mark_mccarthy@gmail.com | Mark | McCarthy |
cassadi_myers@hotmail.com | Cassadi | Myers |
Dictionary:
Field_Name | Metaname | Definition |
EMAIL_ADDRESS | Email Address | This is the email address of the user |
FIRST_NAME | First Name | This is the first name of the user |
LAST_NAME | Last Name | This is the last name of the user |
So we were thinking some type of dynamic load, e.g.,
LET meta= peek('Metaname', $(i), 'Dictionary');
LET field= peek('Field_Name', $(i), 'Dictionary');
LOAD $(field) AS [$(meta)] FROM
and iterate through, but this just creates unconnected tables, I'm no SQL expert and certain there is a better way;-) Why I'm asking all of you!
Thanks again for any help[:D]
Hi,
I think you can do this :
MapRename:
MAPPING LOAD Field_Name, Metaname FROM Dictionnary;
Data:
LOAD * FROM Data;
RENAME FIELDS USING MapRename;
Hope it's gonna be helpful for you
Hi,
I think you can do this :
MapRename:
MAPPING LOAD Field_Name, Metaname FROM Dictionnary;
Data:
LOAD * FROM Data;
RENAME FIELDS USING MapRename;
Hope it's gonna be helpful for you
Hi Martin,
Your solution worked great! Thanks so much for the speedy response, I did not realize the rename capability, very easy!