Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Cumulative Count on multiple dimensions

Hello all,

I am trying to calculate a cumulative count on a straight table with multiple dimensions.

My data is composed of an ID field and 3 dimensions A, B and C.

In my table I calculate the number of occurrences of each pattern A/B/C that I am sorting descending. On top of that I would like to have a cumulative sum of my count(ID), like this:

ABCCount(ID)CumulativeCount(ID)
M

10

Test188
F10Test1715
F20Test2621
M10Test2627
F20Test1431

But I cannot get this Cumulative Count working. I tried full accumulation option, aggr(rangesum(above... and rangecount too but it won't work.

Also I cannot pre-calculate the accumulations in the script as my columns are added dynamically (using enable conditional).

Does anyone have any idea?

Thank you,

Thomas

PS: I attached an example of my problem in qvw

3 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

TOTAL is your friend:

=RangeSum(Above(TOTAL count(ID), 0, RowNo(TOTAL)))

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

Thank you Jonathan, I forgot about TOTAL.

Unfortunately it did not fix the whole thing, but I now have a better idea of what is the problem:

  • [=RangeSum(Above(TOTAL count(ID), 0, RowNo(TOTAL)))] makes the cumulative sum correctly but breaks the sort on the count(ID)
  • [=sum(aggr(rangesum(above(total count(ID),0,RowNo(total))),A,B,C))] partially works too but it uses the order of A,B,C. So when I sort it by count(ID) it doesn't work.

Is there a way to custom sort the temporary table that aggr() is creating?

sujeetsingh
Master III
Master III

follow the links please

Cumulative Straight Table