Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Wrong count totals ?

Hi all,

I have a simple table showing a count of work activities by type (down) and month (across). The expression is simply: count(distinct activity). I am using distinct because for each day there are two records, morning activity and afternoon activity, but I am not interested in this split to be shown in this table.

The issue is that if I add totals they are wrong. What i am looking for is just the sum of the row values (counts), but the totals are different.

Any clue ? how can I get the right totals ? I have noticed that in object Properties totalization rules are grayed when the expression is a count, I don't understand why.

Thanks for helping.

Nik

I am using Ver. 9

2 Replies
Anonymous
Not applicable
Author

Hi,

Since you're using a pivot table the different types of expression totals are greyed out.

The distinct count totals might be different since a certain activity might show up for both Jan and Feb but since we only calculate distinct values the total will just show 1 instance for the activity.

You'll want to use aggr() in your expression to aggregate the counts over each dimension combination and then sum them up. Something along the lines of:

sum(aggr(count(distinct activity), type, month))


Anonymous
Not applicable
Author

Good Answer