Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
BoXiangWang
Contributor III
Contributor III

How to calculate the running total of counting value and show subcategory

Hi all

I am dealing with a running total question. I want to create a bar chart showing the number of employees able to attend courses in the future. 

I use this expression to count the ID of each employee to get the number of people: =Count(ID)

And I can get the running total via this expression: =rangesum(above(Count(ID), 0, RowNo()))

However, when I put an extra dimension in the bar chart to create the stacked bar, I found the figure could not be accumulated. 

 

(1) Original

BoXiangWang_0-1711521856466.png

 

(2) Accumulation

BoXiangWang_1-1711521880390.png

(3) Accumulation + Extra Dimension

BoXiangWang_2-1711521924059.png

 

Is there anything I can get the stacked bar with accumulated amount of count?

 

Any suggestions will be appreciated. Thanks.

Labels (2)
1 Reply
marcus_sommer

You may try it with:

rangesum(above(TOTAL Count(ID), 0, RowNo()))

If this didn't worked you could also try to wrap the calculation with:

aggr(YourExpression, SubKategorie, Date)

whereby aggr() and accumulations against multiple dimensions are not trivial and may not always be working and/or producing any side-effects. Therefore you may need several attempts to find a solution.

I suggest not to do this playing within a bar-chart else within a table-chart because the results are easier to comprehend and it excludes any limitations within the bar-charts because their number of dimensions + expressions in combination with the available settings like grouped or stacked may prevent the intended view.