Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Cumulative totals

Hi Team,

Need your help in getting the cumulative totals in line chart.

I have years from 1920 to 2015. And my requirement is if i select year 2015 the line chart should display years 2015,2014,2013,2013 and the expression should display the accumulative totals from 1920.

ex for 2015 it should display sum of sales from 1920 to 2015 and for 2014 it should display sum of sales from 1920 to 2014.

Please help on this

Thanks

Nani

5 Replies
Not applicable
Author

sorry my mistake if i select year 2015 it should display 2015,2014,2013,2012

Thanks

rakesh_kumar
Creator
Creator

Try something like this:

Sum({<Year= {">=Min(Date) <= ($=(Max(Year))"}>} Sales)

maxgro
MVP
MVP

maybe

sum({$ <year={">=$(=max(year)-4)<=$(=max(year))"}>} aggr(rangesum(above(total sum({<year=>}sales),0,rowno())),year))

testdata:

load

1920-1 + rowno() as year,

1 as sales

AutoGenerate 96;

ankit777
Specialist
Specialist

Hi,

you can try something like this. PFA the QVW file. !

Anonymous
Not applicable
Author

Hi ,

you see use range sum to accumulate the values.

See below example of rangesum

Accumulative Sums

Thanks

BKC