Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
omid5ive
Creator II
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

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar
MVP
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

LOAD *,

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

LOAD * INLINE [

    Ddate, Transaction, Dyear, Dmonth

    20121101, 100, 2012, 11

    20121202, 200, 2012, 12

    20130101, -100, 2013, 01

    20130201, 1000, 2013, 02

];

View solution in original post

2 Replies
sunny_talwar
MVP
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

LOAD *,

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

LOAD * INLINE [

    Ddate, Transaction, Dyear, Dmonth

    20121101, 100, 2012, 11

    20121202, 200, 2012, 12

    20130101, -100, 2013, 01

    20130201, 1000, 2013, 02

];

omid5ive
Creator II
Creator II
Author

thank you Sunny Talwar