Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
justcotto
Contributor III
Contributor III

Calculate count and percentage of total for a specific value in a straight table

I have a data set:

ID Compliance Status
1 Compliant Complete
2 Non-Compliant Incomplete
3 Compliant Completed Elsewhere
4 Non-Compliant Exemption Declined

 

Trying to create two tables that show count and percentage of total by status based on compliance

Compliant:

Status Count % of Total
Complete 1 25%
Completed Elsewhere 1 25%

  

Non-Compliant

Status Count % of Total
Incomplete 1 25%
Exemption Declined 1 25%
13 Replies
stevejoyce
Specialist II
Specialist II

Your 2 tables can have Status as dimension...

Count({<Compliance={'Compliant'}>} ID)

Count({<Compliance={'Compliant'}>} ID) / Count(total ID)

 

2nd table would have Compliance={'Non-Compliant'}

justcotto
Contributor III
Contributor III
Author

Thank you but hat only gives me the percentage of the total compliant. I already went that route.

stevejoyce
Specialist II
Specialist II

I don't follow your issue.  Can you post the output and what you are looking for?

justcotto
Contributor III
Contributor III
Author

I want the percentage of the total count of compliant and non compliant

justcotto
Contributor III
Contributor III
Author

that would give me 50% for each status totaling 200%

stevejoyce
Specialist II
Specialist II

so you want 50% and not 25%?

like this...

Count({<Compliance={'Compliant'}>} ID) / Count(total <Compliance> {<Compliance={'Compliant'}>} ID)

justcotto
Contributor III
Contributor III
Author

I want 25%

stevejoyce
Specialist II
Specialist II

can you screenshot what you are trying to do.  see attached, results are 25%.  first calculations i sent.

justcotto
Contributor III
Contributor III
Author

I could be that I am using Distinct. I created the same inline tale and it works as we are describing