Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

Multi-row formula tool sum prior rows based on date

RCFranks
5 - Atom

Hello - looking for a way to sum values from previous rows based on a date range.  At the start of each month, I want to look back at the prior three months data based on the date.  So not just looking at the prior three rows of data, but looking at the date range.  If the prior two rows of data represent the previous two months but the prior third row of data is from six months back it would not be part of the sum.  Below is sample data.  Thanks for any help!

Sample Data.png

3 REPLIES 3
SPetrie
13 - Pulsar

One way of doing it

SPetrie_1-1678998327585.png

Find the maximum date for each Employee ID and then append that date to each of the rows for that employee.

Then filter out any records that are older than 4 months (current plus 3 previous) and filter out the current maximum month. Use another summarize on the values that are left to get the totals.

 

 

 

RCFranks
5 - Atom

Thank you!  This solution worked for calculating based on prior month.  I was thinking with a multi-row formula tool, the calc could be dynamic and provide a value on each row based on the prior three months.  Similar to the screen grab below.  Is this possible?  Thanks again for the help!

sample data.PNG

SPetrie
13 - Pulsar

Glad that worked. Sorry I misunderstood the original ask. Try this multi-row

SPetrie_0-1679330937576.png

 

Labels
Top Solution Authors