Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Loading useful field names instead of strange database names

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_ADDRESSFIRST_NAMELAST_NAME
thekelleykid@yahoo.comKimKelley
mark_mccarthy@gmail.comMarkMcCarthy
cassadi_myers@hotmail.comCassadiMyers


Dictionary:

Field_NameMetanameDefinition
EMAIL_ADDRESSEmail AddressThis is the email address of the user
FIRST_NAMEFirst NameThis is the first name of the user
LAST_NAMELast NameThis 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]

1 Solution

Accepted Solutions
martin59
Specialist II
Specialist II

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

View solution in original post

2 Replies
martin59
Specialist II
Specialist II

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

Not applicable
Author

Hi Martin,

Your solution worked great! Thanks so much for the speedy response, I did not realize the rename capability, very easy!