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: 
xlSb
Contributor II
Contributor II

Pivot Table not showing the correct Percentages against Totals

Hi,

I'm trying to calculate the percentage for each row (Hour) by column (Day) where the column (Day)percentage should total 100%. But I'm running into an issue where the row total doesn't sum upto 100%. I feel like it has something to do with zero divide by zero. I have tried multiple methods where I have used, if(isnull()), alt(), if( not isnull()) etc

 

 

5 Replies
jmmolero
Partner - Creator
Partner - Creator

could you show the measure expression?

xlSb
Contributor II
Contributor II
Author

sure - =(if(Source=1,count(DISTINCT %Customer)/count(total<Day> DISTINCT %Customer)))

jmmolero
Partner - Creator
Partner - Creator

Did you try with set analysis?:

 

count({<Source={1}>}DISTINCT %Customer)/count({<Source={1}>} total<Day> DISTINCT %Customer)

xlSb
Contributor II
Contributor II
Author

Hi, yes I have also tried with Set Analysis. Below is what the output looks like.

 

 

 

Brett_Bleess
Former Employee
Former Employee

I would recommend reviewing the following Design Blog post regarding Rounding errors, believe that will likely explain things:

https://community.qlik.com/t5/Qlik-Design-Blog/Rounding-Errors/ba-p/1468808

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.