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.

Cumulative Sum based on a range of dates

bersocha
7 - Meteor

Hi everyone,

 

I have the following use case, where I have a the columns: Project, Main Date, Start Date, End Date and Total Savings.

 

I need to sum the total savings from the Start Date to the End Date base on the Main date. I tried everything and I can manage to do it on Alteryx.

 

Below you can see and example (also attached file) of the data and the column result which already has the numbers I'm targeting.

 

Appreciate all your help. 

 

As an example the result 6041.54 from row 5 is the sum of the total savings from 4/1/2023 to 7/1/2024 based on the main date.

 

 

PROJECTMAIN DATESTART DATEEND DATETOTAL SAVINGSRESULT
Project 33/1/2023 3/1/20240 
Project 34/1/20234/1/20234/1/2024377.59595834908.75
Project 35/1/20234/1/20235/1/2024377.59595835286.34
Project 36/1/20234/1/20236/1/2024377.59595835663.94
Project 37/1/20234/1/20237/1/2024377.59595836041.54
Project 38/1/20234/1/20238/1/2024377.59595836419.13
Project 39/1/20234/1/20239/1/2024377.59595836796.73
Project 310/1/20234/1/202310/1/2024377.59595837174.32
Project 311/1/20234/1/202311/1/2024377.59595837551.92
Project 312/1/20234/1/202312/1/2024377.59595837929.52
Project 31/1/20244/1/20231/1/2025377.59595838307.11
Project 32/1/20244/1/20232/1/2025377.59595838684.71
Project 33/1/20244/1/20233/1/2025377.59595839062.30
Project 34/1/20244/1/20234/1/2025377.59595839439.90
Project 35/1/20244/1/20235/1/2025377.59595839817.49
Project 36/1/20244/1/20236/1/2025377.595958310195.09
Project 37/1/20244/1/20237/1/2025377.595958310572.69
Project 38/1/20244/1/20238/1/2025377.595958310950.28
Project 39/1/20244/1/20239/1/2025377.595958311327.88
Project 310/1/20244/1/202310/1/2025377.595958311705.47
Project 311/1/20244/1/202311/1/2025377.595958312083.07
Project 312/1/20244/1/202312/1/2025377.595958312460.67
Project 31/1/20254/1/20231/1/2026377.5959583 
Project 32/1/20254/1/20232/1/2026377.5959583 
Project 33/1/20254/1/20233/1/2026377.5959583 
Project 34/1/20254/1/20234/1/2026377.5959583 
Project 35/1/20254/1/20235/1/2026377.5959583 
Project 36/1/20254/1/20236/1/2026377.5959583 
Project 37/1/20254/1/20237/1/2026377.5959583 
Project 38/1/20254/1/20238/1/2026377.5959583 
Project 39/1/20254/1/20239/1/2026377.5959583 
Project 310/1/20254/1/202310/1/2026377.5959583 
Project 311/1/20254/1/202311/1/2026377.5959583 
Project 312/1/20254/1/202312/1/2026377.5959583 
1 REPLY 1
Yoshiro_Fujimori
15 - Aurora

Hi @bersocha ,

 

Here is a solution with Batch Macro. I hope this helps.

(I skipped the case when the end date is out of range, as I was not sure if it is required.)

 

Main Workflow

Yoshiro_Fujimori_0-1683596749313.png

 

Batch Macro

Yoshiro_Fujimori_1-1683596776776.png

 

Output

Yoshiro_Fujimori_2-1683596806705.png

 

Labels
Top Solution Authors