In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Set up your security questions now so you can recover your account anytime, just log out and back in to get started. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

Duplicate rows using date range

Analyst323
8 - Asteroid

I have an interesting problem...I need to duplicate this row by the number of months between the start and end date. Each row needs to have the date it represents

 

Date Range Problem.JPG

 

 

For example, this row above would need to be duplicated 60 times with each row containing the YYYY-MM it represents. 


I was thinking of doing a datediff on the dates to come up with the number of months. Then use a multi row tool to generate the additional rows and then use the datetimeadd (month) function against the start date to populate the YYYY-MM

 

Open to any other suggestions too!

5 REPLIES 5
alexnajm
19 - Altair
19 - Altair

You should use the Generate Rows tool! It would accomplish this - I am away from my computer but the initialization would be the [Start Date], the condition would be where the [New Column] <= [End Date], and the loop expression would be DateTimeAdd([New Column],1,”days”)

flying008
15 - Aurora

Hi, @Analyst323 

 

FYI. Like @alexnajm Said:

录制_2024_02_01_13_53_59_192.gif

Analyst323
8 - Asteroid

That's great! Had no idea I could use that tool in that way...Thanks for putting that video together!

alexnajm
19 - Altair
19 - Altair

@Analyst323 if it’s not too much trouble, can you accept mine too since it follows the same logic? Thank you in advance!

Analyst323
8 - Asteroid

of course, thank you!

Labels
Top Solution Authors