Alteryx Designer Desktop Discussions

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

How to dynamically rename the first column of your data

Guccio-Gasparrini
7 - Meteor

Hi everyone,

 

I am working on a completing a workflow that will be used for many very different files.

 

In order to make this work I have to dynamically rename the first column the name "X". It has to be dynamic because the column name will always change. The other columns need to stay the same

 

How do I use the dynamic tool to achieve this?

 

I attached a simple file to be changed

8 REPLIES 8
Kenda
16 - Nebula
16 - Nebula

Hi @Guccio-Gasparrini 

 

So long as all of your other fields remain the same, you could use the Dynamic Rename tool. In the configuration, select Formula from the dropdown and deselect all fields except the one field that will change and "Dynamic or Unknown Fields" then simply enter "X" as the expression. This will change the name of any of the incoming selected fields to X and leave the others as-is since we did not select those. 

 

Kenda_0-1641235671872.png

 

apathetichell
18 - Pollux

@Kendra's way totally works - but if you have dynamic fields coming in - those too will be renamed "X". There are a few alternative ways but the easiest (to me) is to set up a text input with one row and one value, let's call it X and the value should be X. Then you use dynamic rename - but this time set to take the values from the right input rows by position. Set it to ignore when there's too few (or too many right input.). Only the first one will have it's values changed. See attached.

AZuc
Alteryx
Alteryx

@apathetichell ,

 

See if it works for you

AZuc_0-1641241306723.png

 

André Zuccatti

Sales Engineer - LATAM -
Alteryx, Inc.


atcodedog05
22 - Nova
22 - Nova

Hi @Guccio-Gasparrini 

 

If you want to dynamically rename the first column with the name "X" and the column name may always change. You can approach like below

 

Workflow:

atcodedog05_0-1641281826516.png

 

1. Use Field Info tool to get column names in order

2. Use Record ID to get row id

3. Use formula tool rename column name when Record ID is 1

4. Use dynamic rename to rename the columns

 

Hope this helps : )

Guccio-Gasparrini
7 - Meteor

Thanks! it works

atcodedog05
22 - Nova
22 - Nova

Happy to help : ) @Guccio-Gasparrini 

Cheers and have a nice day!

amadra
8 - Asteroid

Brilliant!! 😮

benlease
5 - Atom

This worked for me on a similar issue - thanks!

Labels