Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

naphikes
New Contributor II

Add running total to bar chart in reference line

I have a bar chart that plots the number of people who fit a set of categorical values within a particular field (called FieldA here). I'm trying to add a reference line to this bar chart that plots a running total across these categorical values.

I've been able to generate the correct numerical values (ie, the number of people who fit each category, accumulating for each new row in the table) for the reference line by using the following expression within a table:

=RangeSum( Above(Count(FieldA),0,RowNo()) )


However, this expression doesn't generate a plotted line when I place it in the reference line field for my bar chart.

Is there a way to adjust the expression to make it function within the reference line field?

3 Replies
MVP
MVP

Re: Add running total to bar chart in reference line

You will have to use at an expression. It is not going to work as a reference line because reference lines are static lines. But this one is changing based on the dimension.

naphikes
New Contributor II

Re: Add running total to bar chart in reference line

For clarification, are you saying that reference lines must be a) linear and b) either horizontal or vertical only (and depending on chart orientation)? And that any expressions entered into the expression field for reference line most conform to these expectations to be plotted?

MVP
MVP

Re: Add running total to bar chart in reference line

Yes, as per my understanding that's what it needs to be. Reference lines are cannot be moving lines because then they become expressions (line chart or combo chart). Why use reference line if you can replicate it using a line expression