Alteryx Designer Desktop Discussions

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

Duplicate Column and Shift

mquast
8 - Asteroid

I am trying to take a column and duplicate it, but I need to remove the top value and shift everything up by 1 and duplicate the last value. The process is like an upside down staircase and duplicates 39 times. It would also be very helpful to have an example of one that duplicates and does the process 60 times as well. 

4 REPLIES 4
JamesCharnley
13 - Pulsar

Hi @mquast 

 

Sounds like you'll need an iterative macro for this one. I've attached a workbook that shows you how it should work. It's essentially just taking the column that has most recently been skipped, skipping the first record again and joining it back on record position. The other tools are to match the naming convention of your output.

 

dupecolumniterate.png

mquast
8 - Asteroid

@JamesCharnley This is awesome, how would I modify this to duplicate 60 times?

geraldo
13 - Pulsar

@mquast 

 

 

I attach the iterative macro developed by @JamesCharnley  to configure the number of times you need;
click on the macro and configure the amount.

 


I made some adjustments to get the last record so it doesn't get null

 

JamesCharnley
13 - Pulsar

@mquast  I downloaded @geraldo's adjustment and it looks like it'll do the job. Effectively the filter at the end he's added is just checking for how many times the macro has been run, which can be changed with the interface tool!

Labels