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
17 - Castor
17 - Castor

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
14 - Magnetar

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
17 - Castor
17 - Castor

@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