Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

rename columns based on a reference table

janez_007
7 - Meteor

Hi all,

 

is it possible to create a tool that renames columns based on a reference table?

 

The tool should be able to read the current column names (the nr. of columns would differ with each load) and make a "vlookup" and rename the found fields with the values from the reference table and keep the original name, if the value would not be found in the reference table.

 

I have attached an excel, which hopefully demonstrates what I am trying to achieve.

 

Thank you for your help.

 

3 REPLIES 3
Kenda
16 - Nebula
16 - Nebula

Hi @janez_007!

 

This is actually quite easy in Alteryx. All you need is the Dynamic Rename tool. Feed your regular input data into the L input and then connect your lookup table into the R input. To configure the Dynamic Rename, select 'Take Field Names from Right Input Rows' in the first drop down for Rename Mode. Then, select Value for your Old Field Name and select Ref as your New Field Name. 

 

Hope this helps!

NickC
Alteryx Alumni (Retired)

Hello Janez,

 

Please see my solution attached.

 

The simplest solution is to use the dynamic rename option.  However as with everything in Alteryx there are multiple ways to get to the same solution.

 

The alternative solution is to transpose the data, join on the column headers using the reference table, then pivot back into the original format.  

 

 

AndrewPowell
8 - Asteroid

this worked perfectly for me, nice easy solution and saved me creating the aliases in the SQL query of an import tool

Labels