Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
zagzebski
Creator
Creator

Renaming fields via mapping table

I need to automate the renaming of fields.

Table 1 and Table 2 are my fact tables. Beneath those is a transition table that would be used to rename the fields in some automated way...from the "Field" name to the "Master_Field" name.  Although this is a simple example I have a project that will loop through 190 excel files and I need to rename the field names to the "Master_Field". Thanks for any help!

Table 1:

AgencyNum

Agency

1

A

2

B

3

C

4

D

Table 2:

AgencyNum2

Agency2

5

E

6

F

7

G

8

H

Meta Data - Renaming Table:

Field

Master_Field

AgencyNum

AgencyNum

Agency

Agency

AgencyNum2

AgencyNum

Agency2

Agency

6 Replies
settu_periasamy
Master III
Master III

Have you read this How to Rename Fields

zagzebski
Creator
Creator
Author

Thanks - I tried to do something like this but didn't work. I will see if I can make some modifications.

settu_periasamy
Master III
Master III

Ok. you can check the comment section..

you can create the external file for all your fields ($Field) and map your master field.

Anonymous
Not applicable

load

field name as new name,

field name as new name,

field name as new name,

field name as new name

resident table name;

drop main table

try in this way

jonathandienst
Partner - Champion III
Partner - Champion III

I don't believe that you can rename multiple fields to the same target name. Once a field exists, you cannot rename another to have the same name. This is true for the simple rename field command and I expect that it is true for renaming with a mapping table.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Peter_Cammaert
Partner - Champion III
Partner - Champion III

And this is for a very simple reason: a RENAME outside of a LOAD will not join internal symbol tables. Would create a data mess anyway, with all those bit-stuffed pointers spread all over the place...