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.
SOLVED

SumIfs to Create Running Total Based on Date Criteria

koshodi
6 - Meteoroid

Hello!

 

Hope no one attacks me for this, but this may be a case where Excel trumps Alteryx. Hoping someone here can prove me wrong!

 

I am trying to calculate the future payment obligation based on separate date criteria. For example, if DATE (in column) is < 1 year from DATE include in sum payment amount and then continue this formula down. The example attached is how it is done in Excel, I would like to replicate the same in Alteryx. For additional reference, below are the three Excel expressions used to create the obligation buckets.

 

1. =SUMIFS($C$4:$C$20,$B$4:$B$20,">"&EOMONTH(B4,0),$B$4:$B$20,"<="&EOMONTH(B4,12))  == <1 Year Payment

2. =SUMIFS($C$4:$C$20,$B$4:$B$20,">"&EOMONTH(B4,12),$B$4:$B$20,"<="&EOMONTH(B4,60))  == >=1 Year AND <5 Year Payment

3. =SUMIFS($C$4:$C$20,$B$4:$B$20,">"&EOMONTH(B4,60))  == >5 Year Payment

 

  Future Obligation Buckets  
Full DateFixed Payment<1 Year -
Payment
>1 year and <5 years - Payment>5 years - Payment
04/01/202010           20                      100            40
05/01/202010           10                      100            40
06/01/202010              -                      100            40
07/01/202110           80                        20            30
08/01/202110           70                        20            30
09/01/202110           60                        20            30
10/01/202110           50                        20            30
11/01/202110           40                        20            30
12/01/202110           30                        20            30
01/01/202210           20                        20            30
02/01/202210           10                        20            30
03/01/202210              -                        20            30
04/01/202510              -                        40               -
05/01/202610              -                        30               -
06/01/202710              -                        20               -
07/01/202810              -                        10               -
08/01/202910              -                            -               -
3 REPLIES 3
Blake
12 - Quasar

Hi @koshodi 

 

I hope you haven't been attacked on the Alteryx community before! Some users are pretty passionate... 

 

See below and attached for an example of how to build out your process in Alteryx. Solving problems in Alteryx is generally different than in Excel but can be more dynamic and arguably more fun! 

 

I started by converting your provided dates to a date format and appended all records to each other. I then filtered out any dates in the past or equal to the date being calculated. After that, I determined which bucket a date would fall in and crosstabbed to get the results. One Dynamic rename later, you have your table! 

 

kodi3.pngkodi1.png

 

 

 

 

 

 

I created a little lookup table for the names of the buckets. This could have been done differently but I wanted to keep it relatively straight forward. 

 

I also spit balled the days for less than a year and 1-5 years because Leap Days are weird. 

 

Hope this works for you, good luck on your Alteryx learning journey!

 

 

koshodi
6 - Meteoroid

Apologies for the late response. But yes, this worked like a dream! Leap days were definitely tricky but for my particular scenario switching from "days" to "months" seemed to work just fine.

 

Also, in the cross tab tool, I summed the appended payment amount which I renamed to "FUTURE_PAYMENT" instead of the original amount. Not sure if that makes a huge difference but figured I'd let any interested parties from the community know.

 

Thanks for the help!!

koshodi
6 - Meteoroid

Hello,

 

Thanks again for your original response on this. I do have a follow-up question as you had mentioned that this could be accomplished differently.

 

Although this solution worked great for the example provided and, subsequently, my test data, in actual production (think: 100,000+ rows of data) the append tool takes a significant amount of time (~1 hour) to run and does not seem sustainable as the amount of data will only increase going forward. Would an alternative solution account for the large amount of data?

 

Thanks!

Labels
Top Solution Authors