Alteryx Designer Desktop Discussions

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

Duplicate columns

konjo
5 - Atom

I'm a compete newbie with Alteryx and was wondering if I could achieve this using the tool.

 

I have a table with data and need some of the columns to be duplicated. Normally I would use a formula to achieve this, but in this case I have a list of columns-to-be-duplicated and the-number-each-column-needs-to-be-duplicated in a separate data set. Can this be done dynamically and how?

2 REPLIES 2
nick_ceneviva
11 - Bolide

The attached workflow would be one way to dynamically duplicate columns where needed.  Take a look and let me know if you have any questions!

 

Essentially, use a the transpose tool to create a row for each of your columns.  Where there is a need for duplicate columns, you can use the Generate row tool to create the necessary number of columns based on the specified amount from the text input tool.  The one part I wasn't sure about was what name you wanted to give the new headers but for now I have just used an Indes (So if column A should have 2 duplicates it is A1 and A2).  You can union the newly created rows back to the rows that did not need to be duplicated and use the cross tab tool to undo the transpose.

konjo
5 - Atom

That is awesome. Exactly what I needed.

Thanks a lot for your help!

Labels