Alteryx Designer Desktop Discussions

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

Rename variable number of new columns

JUUP
7 - Meteor

I have a set of user data that has a column "User Code" that has 1, 2 or 3 values for each user:

 

User #User Code
1ABC
1DEF
2

ABC

3

DEF

3

GHI

3

JKL

 

The workflow looks at one user's data at a time. For any given row of data, there is one User Code listed. The next row will display the next User Code and so on, repeating for as many rows as the User has:

 

User #User Code
3DEF
3GHI
3JKL
3DEF
3GHI

 

I used CrossTab to break them out so each customer has one column for each of their codes:

User #DEFGHIJKL
3DEFGHIJKL
3DEFGHIJKL
3DEFGHIJKL

 

This is exactly what I want, except for the column headers ("DEF," "GHI," "JKL"). I can use Select to rename them to "Code1," "Code2", and "Code3," but if the next user doesn't have the same codes, they won't be selected to be renamed ("ABC," for example, would not be picked up in the above example).

 

I suspect the Dynamic Rename tool is the way to handle this, but I can't figure out how. I appreciate any guidance you can share! Thanks.

3 REPLIES 3
JosephSerpis
17 - Castor
17 - Castor

Hi @JUUP I mocked up a workflow that should be dynamic and handle if you have a different number of codes. Let me know what you think? 

JUUP
7 - Meteor

Hi @, that workflow is handling the column renaming perfectly. Thanks for your help!

JerryHare
5 - Atom

Thanks. This helped me solve a similar situation.

Labels