In case you missed the announcement: Alteryx One is here, and so is the Spring Release! Learn more about these new and exciting releases here!

Alteryx Designer Desktop Discussions

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

How to rename columns in an efficient way.

AnaLG
7 - Meteor

Hi, 

I have a dataset with different column I want to rename based on a universal naming convention. I tried to do what was indicated in one solution to a similar problem and I don't know what I am getting wrong, but it is not working, as it is not changing the name of my columns. The following is what I did:

  • I created a Reference table in Excel that contains two columns: one for the original names and another one for the corresponding default names (the universal ones).
  • Use the Join tool to join your input data with a reference table.
  • Configure the Join tool to perform a Left Join, so that all records from your input data are included.

The aforementioned did not work. So, instead I did this:

  • Added a ‘Dynamic Rename’ node, that is going to check the way fields are written, and rename them.  This is simpler but not efficient as I will have to write all the possibilities that columns might be called.

So, would anyone be able to assist and tell me what I am doing wrong/missing in the first solution and why is not renaming anything for me?

 

Thanks so much in advance!!!

 

4 REPLIES 4
alexnajm
18 - Pollux
18 - Pollux

Couldn't you use the Dynamic Rename tool to rename by "Take Field Names from Right Input Rows"?  Dynamic Rename Tool (alteryx.com)

AnaLG
7 - Meteor

Hi @alexnajm. That seems to be working perfectly! Thanks a million.

MWoelfels
6 - Meteoroid

Hi all, hi Alexnajm, 

 

sorry for entering an already solved case. However, while adopting your solution another question came up and I do need some help.

 

I have inputs including a date in the file name, say "20240906" for YYYYMMDD. During import, I chose the import filename, extracted the Year month in a new field [Extracted Date] and played a little with cross tab / transpose to get "202409" either as a column or a value. Also, this input file contains colums such as "Name", "Amount", "Number".

 

What I need to do is to dynamically add the extracted date as a suffix after the field names. Result should be "Name 202409", "Amount 202409" and "Number 202409".

Using "dynamic rename" and "Add suffix" only allows to enter a static value followed by my decision to add this value as a prefix or suffix. But I need to enter the value dynamically, here dependent on the date in the filename.

 

Your soluting with "Take Field Names from Right Input Rows" sounds great, however I struggled to implement a proper solution.

Even with using cross tab for the FileName/extracted date and trying to use a multi-row formula creating new values with "[Name] + [Exctracted Date]" and then transpose it as my final columns failed.

 

Any suggestions on dynamic suffixes?

Thank you in advance,

 

Michael

alexnajm
18 - Pollux
18 - Pollux

Hi @MWoelfels, it is better to start a new thread so other Alteryx users can be notified of your question and keep this thread related to the original question. Thank you!

Labels
Top Solution Authors