Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
rittermd
Master
Master

Total not calculating correctly

I have a Master Measure that calculates a percentage for a column in my table.

When I use this version the grand total is 17.0%

(Count({<DestName={'SNF'}>} AGE)) /

(Count(AGE))

When I use this version the grand total is 20.1%

//Aggr(Count({<DestName={'SNF'}>} AGE), ServiceLineDescription) /

//Aggr(Count(AGE), ServiceLineDescription)

The actual total is really 20.4% which I get when I calculate a variable with

Num(Count({<DestName={'SNF'}>} AGE)/Count(AGE), '##0.0%') and display the result.

Something is happening inside the table that is not happening in the variable.

The calculation for each row for this % is correct.  It is just the total row that is off a bit. 

What do I need to change to make the total correct with 20.4%?

13 Replies
sunny_talwar

Are you trying this in a KPI object or total of a table?

rittermd
Master
Master
Author

The total row for the table.  I suspect it will show the correct 20.4% in a KPI.

rittermd
Master
Master
Author

It does show the correct amount in the KPI as it does in the variable.

sunny_talwar

Can you check in a KPI to see if it is indeed showing 20.4%? Also, are you suppressing null dimension by any chance?

rittermd
Master
Master
Author

I did not have the Show Null box checked.  But even after I checked it the total % did not change.

sunny_talwar

May be use Dimensionality() function

If(Dimensionality() = 0, YourVariable, Count({<DestName = {'SNF'}>} AGE)/Count(AGE))

rittermd
Master
Master
Author

That did not change anything. 

Also, this is not a pivot table.  Just in case you assumed that.

rittermd
Master
Master
Author

I also changed the expression to just use the variable.

Rows are still correct but total is still 17.0%

sunny_talwar

Would you be able to share a sample?