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

split time period into rows

Mic
6 - Meteoroid

Hi There!


I am looking for a way to split the time period into the individual months and based on the days, split the invoice amount.

 

Example

If my data looks like this:

Start

End

Invoice_Amount

2021-02-05

2021-02-20

50,18

2020-10-30

2021-03-05

129,83

 

 

I would like that if a period goes over several months, rows are automatically generated, and the invoice amount is split proportionally to the days.

My output should look like this (the last two columns I can already calculate):

Mic_0-1629196955079.png

 

I hope someone can help me

BR

2 REPLIES 2
kelly_gilbert
13 - Pulsar

Hi, @Mic - this is a great use case for the Generate Rows tool!

 

Here, we are telling it to start at the [Start] date, then increment by one month until the [End] date is reached:

 

kelly_gilbert_1-1629242355421.png

 

From there, you can use a Formula tool to calculate the end of date, e.g. min([End], datetimeadd(datetimeadd(datetimetrim([START_period], 'month'), 1, 'month'), -1,'day')),

as well as your number of days in the period.

 

 

Mic
6 - Meteoroid

Hi @kelly_gilbert

 

Thanks for your help. It works perfectly. 

Labels
Top Solution Authors