Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
cmc
Contributor II
Contributor II

Accumulation of a fraction measure in a line graph

I have a line graph with a measure that is a fraction e.g. sum(A) / sum(B).

I would like to accumulate the values of A & B separately. I don't want the total measure values to simply be summed up for each step of the line graph.

Currently, my expression looks like this:

=
RangeSum(Above(
Sum(A)
,0,RowNo()))

/

RangeSum(Above(
Sum(B)
,0,RowNo()))

This works when there is no dimension breakdown in the line graph (e.g. there is only 1 line), but when I add a line dimension, the calculations are incorrect for the accumulated measure.

 

cmc_1-1696952221081.png

cmc_0-1696952193683.png

 

Labels (3)
2 Replies
sbaro_bd
Creator
Creator

Hi @cmc ,

What happen if you declare the dimension inside an aggregate function like this : 

 

AGGR(your_cumulative_expression, purch_quarter)

 

Regards.

cmc
Contributor II
Contributor II
Author

Hi @sbaro_bd , when I try this method, the result looks like this:

cmc_0-1696956491728.png

Same if I wrap the numerator and denominator in the aggr() separately.