1 Reply Latest reply: Jun 1, 2017 2:45 PM by Settu Periyasasamy

Rolling / cumulative sum of days

Hello,

I calculated Active Days with the following expression:

Monthend(Max( [TRANS_DATE]))-

Monthstart(Min([TRANS_DATE]))

Now I want to have a running total for active days, see the last column below:

 CUSTOMER_ID RTI_NAME Year MonthYear Active Days 762 1000009371 Prod x 2017 06-2017 30 762 1000009371 Prod x 2017 05-2017 31 732 1000009371 Prod x 2017 04-2017 30 701 1000009371 Prod x 2017 03-2017 31 671 1000009371 Prod x 2017 02-2017 28 640 1000009371 Prod x 2017 01-2017 31 612 1000009371 Prod x 2016 12-2016 31 581 1000009371 Prod x 2016 11-2016 30 550 1000009371 Prod x 2016 10-2016 31 520 1000009371 Prod x 2016 09-2016 30 489 1000009371 Prod x 2016 08-2016 31 459 1000009371 Prod x 2016 07-2016 31 428 1000009371 Prod x 2016 06-2016 30 397 1000009371 Prod x 2016 05-2016 31 367 1000009371 Prod x 2016 04-2016 30 336 1000009371 Prod x 2016 03-2016 31 306 1000009371 Prod x 2016 02-2016 29 275 1000009371 Prod x 2016 01-2016 31 246 1000009371 Prod x 2015 12-2015 31 215 1000009371 Prod x 2015 11-2015 30 184 1000009371 Prod x 2015 10-2015 31 154 1000009371 Prod x 2015 09-2015 30 123 1000009371 Prod x 2015 08-2015 31 93 1000009371 Prod x 2015 01-2015 31 62 1000009371 Prod x 2014 12-2014 31

Can somebody explain how to do this?

Kind regards,

Erik

• Re: Rolling / cumulative sum of days

Try this.

sum(TOTAL MonthEnd([TRANS_DATE])-MonthStart([TRANS_DATE]))-Rangesum(Above(TOTAL MonthEnd([TRANS_DATE])-MonthStart([TRANS_DATE]),1,RowNo(TOTAL)),0)