Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Subtotal expression in pivot table

Hi all,

I need to create a table with subtotals as count of rows in table for each dimension value. I believe i can use 'Label for totals' on Presentation tab, but i can only achieve count of rows over whole table, not grouped by dim1. In the example bellow there should be Count 5 and Count 3, not Count 8 in both rows.

Could you please suggest me any solution?

Many thanks.

1 Solution

Accepted Solutions
sunny_talwar

See if this helps:

=If(Dimensionality() = 1, Count(Aggr(Sum(value), dim1, dim2)), Sum(value))

Capture.PNG

View solution in original post

5 Replies
sunny_talwar

See if this helps:

=If(Dimensionality() = 1, Count(Aggr(Sum(value), dim1, dim2)), Sum(value))

Capture.PNG

Anonymous
Not applicable
Author

Thank you Sunny  for your valuable advice, but it is not exactly what i would like to get. In picture bellow I noted which values im not satisfied with.

Kushal_Chawda

Hi,

For this you need to use Dimensionality() function, but this function will not be evaluated in Label. It will work only in expression. So you will not be able to display Count 5 and Count 3

Anonymous
Not applicable
Author

I think he is talking about Count 8 label, he want to replace it Count 5 in case of 5 dim and Count 3 in case of 3 dim...

I do not think this would be possible becoz Label of Total would be common for whole table.

Anonymous
Not applicable
Author

Ok guys, thanks for your effort, i accept that this should be solved within expression, im going inspect dimensionality() usage.