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

Alteryx Designer Desktop Discussions

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

Cumulative Total Formula

harinder1301
8 - Asteroid

Hi,

I would like get the total column depending upon the current month of the year .

Please see my below data  :

YearMonthScoreUpperLimit
2018Jan1024/01/2018
2018Sep2024/01/2018
2019Jan2024/01/2019
2019May1024/01/2019
2019Oct1024/01/2020
2020Jan3024/01/2020
2020Oct1024/01/2020

 

And I would like to calculate a new column as "Total score" known by at this point in that year. Please see the desired outcome:

 

YearTotal Desired Outcome comments
201810Total Outcome known by Jan 2018 is 10
201950Total Outcome known by Jan 2019 is 50
202090Total Outcome known by Jan 2020 is 90

 

Just wondering if i can achieve it using Multi Row formula?

 

Appreciate your reply!

Thanks

Harinder

9 REPLIES 9
atcodedog05
22 - Nova
22 - Nova

Hi @harinder1301 

 

Here is how you can do it.

Workflow:

atcodedog05_0-1643026854052.png

 

Hope this helps : )

 

harinder1301
8 - Asteroid

Thank You, Much appreciated!

atcodedog05
22 - Nova
22 - Nova

Happy to help : ) @harinder1301 

Cheers and have a nice day!

harinder1301
8 - Asteroid

Hi

 

The question I am trying to answer is If today is 24/01/2022 , what was the total score on this day and month in 2018,2019 and 2020?

 

The workflow is working ok if we have at least one matching month and day(<less than upper limit day/month).

 

But for the scenarios like this , I am getting 0 records .

 

YearMonthScoreUpperLimit   Day*   Month of dateDay of dateRunTot_Score
2018Feb1024/01/201820Jan2410
2018Sep2024/01/201810Jan2430
2019Jan2024/01/201925Jan2450
2019May1024/01/201910Jan2460
2019Oct1024/01/20202Jan2470
2020Jan3024/01/202030Jan24100
2020Oct1024/01/20202Jan24110

 

Instead I want the output like this:

2018: 30

2019:30  //[Total Value from the date < 24th January]

2020:70

Appreciate your advise on this.

Regards

SoccerTil
8 - Asteroid

not sure exactly what your calculation needs to be as your output doesn't seem to consistently match your data. does the value for Sep 2018 superceed the value for Jan 2018 when running the total for Jan 2019? If so then your output set should be

10 for Jan 2018

40 for Jan 2019

60 for Jan 2020

 

If they are individual reports then your output should be

10 for Jan 2018

50 for Jan 2019

100 for Jan 2020

 

Or am I mistaken? Please clarify.

harinder1301
8 - Asteroid

Hi,

Thanks for the reply.

Basically the total score at this point of each year which is (on our before 24 jan of 2018,2019,2020).

Thanks

 

SoccerTil
8 - Asteroid

Then your issue is not just running totals but a complex filter on the data, or a non-equijoin. How are you with macros?

SoccerTil
8 - Asteroid

I saw an issue with your data. If I understand your requirements the data input should be:

SoccerTil_0-1643232912447.png

row 5 should have upper limit of 24/01/2019 not 24/01/2020. 

 

Then I can get this results w/o a formated comment

SoccerTil_1-1643233001590.png

The attached workflow isn't pretty, but it gets the job done with the data you provided. Essentially, records in or before the current month in their year get reported in their own year. Records after the current month in their own year get reported in the next year. Records after the current month in the current year don't get reported. The workflow creates the fields required to summarize by reporting year and then generating the running total.

harinder1301
8 - Asteroid

Excellent! Thank you very much.

Labels