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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
johnnyjohn
Creator
Creator

Line Graph Accumulation

Apologies for earlier post, I've managed to distill down the issue significantly. 

As you can see in the data table below, using this expression below, I've managed to calculate the cumulative sum of the n5_value_EUR relative to the n0_marketcap_group - so both market caps add up to 1 at the end of their respective clock (up to 1). 

So this works in the table viz. 

RangeSum(Above( Sum(n5_value_EUR), 0, RowNo()))
/
Sum( TOTAL <n0_marketcap_group> n5_value_EUR )

johnnyjohn_0-1761585368454.png

Trying to put this same measure in a line chart, it breaks, and doesnt actually accumulate across the dimensions. 

johnnyjohn_1-1761585513313.png

Any thoughts on how to do this on a line chart ?

 

Labels (3)
2 Replies
MatheusC
Specialist II
Specialist II

@johnnyjohn 

Try using aggr() with your field ordering


aggr(
RangeSum(
above(
Sum(n5_value_EUR)
/
sum( total <n0_marketcap_group> n5_value_EUR),0,RowNo())),
(n0_marketcap_group,(=Sum(n5_value_EUR),Desc)),Clock)



Did you find a solution to your question? Mark the solution as accepted and if you found it useful, press the like button!
johnnyjohn
Creator
Creator
Author

Hello, thanks for the suggestion, no luck with the expression unfortunately. Below is a simple sample dataset, just in case it helps you create the expression for the line graph.

On a line chart, Group=Clock (continuous axis), Line=n0_marketcap_group, Height Of Line= the expression that makes this relative cumulative sum per market cap. 

Many thanks 

+-------------+------------------+----------------+
|n5_value_EUR |n0_marketcap_group| Clock          |
+-------------+------------------+----------------+
| 5082        | Mid              | 0.00           |
| 1436        | Mid              | 0.03           |
| 1286        | Mid              | 0.23           |
| 2275        | Mid              | 0.23           |
| 1483        | Mid              | 0.54           |
| 1755        | Mid              | 0.54           |
| 1628        | Mid              | 1.00           |
| 39759       | Small            | 0.00           |
| 1904        | Small            | 0.50           |
| 364         | Small            | 0.50           |
| 3683        | Small            | 0.50           |
| 1281        | Small            | 0.53           |
| 618         | Small            | 1.00           |
+-------------+------------------+----------------+