Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Cumulative sum of values at the end of a line graph

Hi Experts,

I have the below requirement. I need to show the sum of all the values per year at the end of each line( the box in red).

Can you please help ?

Sum in chart.JPG

Thanks in advance.

Regards,

Nayana

4 Replies
Gysbert_Wassenaar

Can you post a small qlikview document that illustrates the problem?


talk is cheap, supply exceeds demand
petter
Partner - Champion III
Partner - Champion III

You can make each expression into a Dual-value and let the text part be the Sum(TOTAL .... ) if the dimension is the last dimension value:

Dual(

      If( RowNo(TOTAL) = NoOfRows(relativeYear) , Null() , Sum(TOTAL measureForYearNN ) )

      , Sum( measureForYearNN )

)

Not applicable
Author

Hi,

The lines shows the value of a column with respect to years.

Each year has a 7 year data format-hence year1-year7 format.

What is required now is that the sum of all values for any year should show up.

Client has asked for sum in a red box at the end of each line but anything similar would work.

Thanks in advance.

Regards

nico_ilog
Partner - Creator II
Partner - Creator II

Found this awesome video that explains it perfectly.

https://www.youtube.com/watch?v=AlT_jAMsiGU

Credit to: Christof Schwarz

The basic idea is this:

You need to Create 2 variables in Qlik Sense. I just used the editors variable creation window.

Variable 1:

Name:accum

Value:='RangeSum(Above('

Variable 2:

Name:/accum

Value:=',0,RowNo(TOTAL)))'

Usage:

$(accum)(Your Measure)$(/accum)

NOTE:

If you are going to create the variable using the SET function, in the script. Then you need to change these (' ') to these (" ").

Let me know if it helped.

Nico