Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Community is experiencing an influx of spam. As we work toward a solution, please use the 'Notify Moderator' option on the ellipsis menu to flag inappropriate posts.

Alteryx Designer Desktop Discussions

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

Repeat Only Change Years

Hongli1216
8 - Asteroid

Hi,

 

Thanks for your help in advance! Please see the attached file. How to repeat the range of (row 2-row 8), just change the years in Alteryx, like from 2019 to 2040? Appreciate your time!

 

Holly

7 REPLIES 7
cs11
8 - Asteroid

Hi, if you always want to select specific rows 2-8 then you can use the Select Rows tool, per the attached, and then a Union to add this to your data after changing the date. But this approach is not dynamic based on any criteria in the data, only statically copying over rows 2-8

Hongli1216
8 - Asteroid

CS,

 

Thanks for your time! I want to repeat these rows but change the years from 2019, 2020, 2021....until 2040. 

 

Holly

cs11
8 - Asteroid

A batch macro should work - the attached has date inputs from 2019-2023 and repeats the 8 columns accordingly, consolidating into one file. If this is the goal you are looking for then you should be able to expand the year list to 2040 and get the end file you need.

cs11
8 - Asteroid

Actually you can just use a generate rows tool to create the year list, so that would also make it one step easier to implement.

Hongli1216
8 - Asteroid

cs,

 

I cannot download your attachment. Can you put your formula or tools here? Appreciate it!

 

cs11
8 - Asteroid

there is actually an easier way, which is just to use the Append Fields tool to create the Cartesian Product between the rows 2-8 and the year list, per the attached. No macro is required. See if the attached is what you are looking for.

Hongli1216
8 - Asteroid

cs,

 

Thanks for your great help! Save me a lot time! Appreciated your patience! 

 

Holly

Labels