Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Dynamic rename question - How to dynamically rename columns as F1, F2, F3 and so on?

csun1994
7 - Meteor

I used a select tool following file import so my first column is column F35. Following this, how do I rename the columns based on the remaining columns after the select tool, such that F35 (the first col) is now F1, F36 is F2, F37 is F3, and so on? I've tried dynamic rename, not sure if that works.

 

Thank you

6 REPLIES 6
csun1994
7 - Meteor

I want to add, not manually through the select tool, there needs to be a way that the column that starts on F35 is immediately changed to F1, and so on, so that F35-F40 in the unchanged dataset is now F1-F6 after being renamed.

ShankerV
17 - Castor

Hi @csun1994 

 

Yes, it will work if you link it with the field names in another input.

 

 

Many thanks

Shanker V

markcurry
12 - Quasar

Hi @csun1994 ,  hopefully the attached workflow will help.

 

 

ShankerV
17 - Castor

Hi @csun1994 

 

Explaining with a use case below.

 

Full workflow:

ShankerV_0-1669399392794.png

 

Input 1:

 

ShankerV_1-1669399423688.png

 

 

After select tool:

 

ShankerV_2-1669399442183.png

 

 

Input tool 2:

ShankerV_3-1669399467012.png

 

After dynamic rename:

ShankerV_5-1669399536665.png

 

 

Output as you expected:

 

ShankerV_4-1669399487687.png

 

 

Many thanks

Shanker V

 

DataNath
17 - Castor

@csun1994 within Alteryx, we're not allowed duplicate field names. Therefore, we can use the following expression to make the first field 'F1' and then force an ascending numeric rename of subsequent fields (F2 onwards):

 

DataNath_0-1669400701016.png

DataNath_1-1669400724315.png

martinding
13 - Pulsar

If you know the column that you are selecting (for example, always F35) then it is simple. 

Simply subtract 34 from all selected new columns using the Dynamic Rename Tool.

 

WeChat Screenshot_20221126121129.png

WeChat Screenshot_20221126121147.png

Labels