Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
klbos
Partner - Contributor II
Partner - Contributor II

Accumulative sum per year in Line chart

Dear community, 

I have searched in I think almost every rangesum qeastion the past few days but I could not find a solution. 

I want an accumulative sum per year in a line graph,with month as horizontal dimension. The expression I use now is :

RangeSum(Above(total Sum( Omzet), 0, RowNo(total)))  

I want that every line starts at  0 and ends on the total revenue of that year. 

Can anyone help me?

 

Below the data

Example.png

Kind regards, 

Klaas

 

 

Labels (1)
8 Replies
Sue_Macaluso
Community Manager
Community Manager

Hi, Is this for QlikView or Sense? I would like to move it into the correct product forum for more attention. This forum is typically for general discussion.
Sue Macaluso
klbos
Partner - Contributor II
Partner - Contributor II
Author

Hi Sue,

This is for Sense. 

dlm
Employee
Employee

Hi,

I think you have the expression slightly wrong.

Try and put it as follows in your line chart:

rangesum(above( sum(Revenue), 0, rowno() ))

I've created a small inline table with your 2016 data and it seems to add up correctly. Please note that I haven't attached it to a proper date field, so month 4 (which is not included into your data set for 2016) is not shown in the chart.

 

I hope this helps.

Best regars,

 

klbos
Partner - Contributor II
Partner - Contributor II
Author

Hi,

Thank you for your response. 

I already tried that expression but it is not working if I have year as second dimension (several years)

response.png

Regards, 

 

 

dlm
Employee
Employee

Ah, yes you're right.

what about if you try the following:

(Aggr(RangeSum(Above(Sum(Revenue), 0, RowNo())), BookingYear, BookingMonth))

Seems to work in my example attached.

Best regards,

 

klbos
Partner - Contributor II
Partner - Contributor II
Author

Dear DLM,

For some reason that works with the inline table but not with my whole dataset.

 

 

 

Answer 2.png

dlm
Employee
Employee

Are the fieldnames in the ‘inline table’ exactly the same as in your data model?
klbos
Partner - Contributor II
Partner - Contributor II
Author

Jup! Are exactly the same. 

I can solve it with several measures with Set analysis on the year field, but than it's not possible to select years.