Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Changing field names dynamically

Jake5
8 - Asteroid

Hello, I have a workflow that uses two, dynamic inputs for consuming two, different files where several of the column headers (fields) vary.  The workflow is set up to where dynamic input #1 reads in the first file saved to a folder and input #2 reads in the second file.  But for subsequent instances where these files are saved off, that order could change.  Therefore, I'm trying to figure out the best way to dynamically change the field name so that the preferred header prevails.  For example, one file may use the field name 'Rate' whereas the other uses 'Basis Pts'.  Desired outcome is for the field to be labeled 'Rate' irrespective of which file it reads in.  Somewhat of a junior user so prefer a solution that does not involve a macro.  Any help is greatly appreciated - thanks!

 

 

 

6 REPLIES 6
MeganDibble
Alteryx Community Team
Alteryx Community Team

Hi @Jake5,

 

You could create a lookup table like the one below with a text input tool. Then, after bringing in both data sets, you can use the dynamic rename tool on each data set. The right input on the tool will be your lookup table. In the configuration window for the dynamic rename tool, select the "Take Field Names from Right Input Rows" option so that the old headers will be replaced with the desired headers, and the desired headers will remain unchanged.

 

Hope this helps!

 

Old Header New Header
Basis Pts Rate
etc

etc

Jake5
8 - Asteroid

Hi @MeganDibble 

 

Thanks for responding.  I did give that a try but for some reason it's not yielding the expected results.  I've attached an example.  You'll notice after it runs, the original input field headers do not update as expected - i.e. Basis Pts should update to Rate (Bps), Avg Daily Balance to Billable Assets.  Am I missing a step?  

MeganDibble
Alteryx Community Team
Alteryx Community Team

Hi @Jake5 ,

 

The thing you need to change is the configuration of the dynamic input tool. When you switch it to the configuration below, are you seeing your desired results?

 

Screen Shot 2022-05-09 at 9.29.35 AM.png

 

Jake5
8 - Asteroid

Unfortunately - no.  Referencing the workflow I previously attached, I updated the Field Name from Column to = Field1 and New Description from Column = Field2 and it's still not updating.  I would expect Basis Pts to be replaced with Rate (Bps) and Avg Daily Balance to be replaced with Billable Assets.  Please see below.  

 

Jake5_0-1652118106167.png

 

MeganDibble
Alteryx Community Team
Alteryx Community Team

Sorry I didn't catch this--the rename mode should be set to "Take field names from right input rows" not "take field descriptions from right input rows"

Jake5
8 - Asteroid

Thank you!  That worked :)

Labels