Announcements
cancel
Showing results for
Did you mean:
Creator II

## Cumulative sum in chart

hi

i need a chart like attached dashboard that show cumulative sum

in dimension i have date group and in expression i have sum(transaction)

i need that when user drill to 2013 year he see 200 on chart it means that i need sum last year value andcurrent value

hat should i use in expression

1 Solution

Accepted Solutions
MVP

Try this

=If(GetCurrentField([G1]) = 'Dyear',

RangeSum(Above(TOTAL Sum(Transaction), 0, RowNo(TOTAL))),

Aggr(RangeSum(Above(TOTAL Sum({<Dyear>}Transaction), 0, RowNo(TOTAL))), MonthYear))

Where MonthYear is created in Script like this

Date(MonthStart(Date#(Ddate, 'YYYYMMDD')), 'MMMYYYY') as MonthYear;

Ddate, Transaction, Dyear, Dmonth

20121101, 100, 2012, 11

20121202, 200, 2012, 12

20130101, -100, 2013, 01

20130201, 1000, 2013, 02

];

2 Replies
MVP

Try this

=If(GetCurrentField([G1]) = 'Dyear',

RangeSum(Above(TOTAL Sum(Transaction), 0, RowNo(TOTAL))),

Aggr(RangeSum(Above(TOTAL Sum({<Dyear>}Transaction), 0, RowNo(TOTAL))), MonthYear))

Where MonthYear is created in Script like this

Date(MonthStart(Date#(Ddate, 'YYYYMMDD')), 'MMMYYYY') as MonthYear;

Ddate, Transaction, Dyear, Dmonth

20121101, 100, 2012, 11

20121202, 200, 2012, 12

20130101, -100, 2013, 01

20130201, 1000, 2013, 02

];

Creator II
Author

thank you Sunny Talwar

Community Browser