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.
Solved! Go to Solution.
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!
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.
this worked perfectly for me, nice easy solution and saved me creating the aliases in the SQL query of an import tool