Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
DrDanSzuhay
Contributor II
Contributor II

Wanting to get percentages

Hi, 

I am new to Qlik Sense. We want to get the percentage of No Entry's in a patient's S*xual Orientation field compared to the total number of patients per provider. Note I had to add an "*" to be able to post

So the data table has let's 90 Admission Programs with some number of patients. For example, for Admission Program A there are 100 patients of whom the field S*xual Orientation was not completed and was assigned "No Entry." For that Admission Program then, we want to display 26%, which is 26/100. We want to do this for every provider.

Here is an attempt to generate that percentage, which does not work, but got us something. We have a bar chart with with the Y axis being Admission Program and we want the x axis to be the percentage of No Entry/total patients per Admission Program for each Admission Program.

SUM(xtPatientSupp.s*xual_orientation_value='No Entry')/SUM(Total{PatientSupp.s*xual_orientation_value})

Any help would be greatly appreciated.

 

 

Labels (5)
5 Replies
JR4
Contributor II
Contributor II

I usually wind up doing something like this to get percentages like that:

COUNT({$<PatientSupp.s*xual_orientation_value={"No Entry"}>}[FIELD]) / COUNT(TOTAL [FIELD])

If you have a field for a patient ID or something similar, replace [FIELD] with that. It should return the percentage of patient ID's (or the field you choose) that have a s*xual_orientation_value of "No Entry". Let me know if this works for you!

 

DrDanSzuhay
Contributor II
Contributor II
Author

Hi JR4. It worked partway. What we want is to figure out the percentage on No Entry for each Admission Program based on ONLY the responses for each Admission Program.

When using the PATID only, it figures out the percentage for each Admission Program against all PATIDs in the system so the total percentage for all Admission Programs equal 100%. 

What we want is: Provider A has 100 PATID's. 74 entered a value into the S*xual Orientation field and 26 did not. The percentage for No Entry for Provider A should be 26% or 26/100.

In the solution you provided if there were 1000 PATIDs for 10 providers then the percentage generated would be 26/1000 or 2.6%, which is the percentage of No Entry for Provider A against ALL Providers which is not the percentage we want.

 

 

Chanty4u
MVP
MVP

Try this 

Count({<s*xual_orientation_value={'No Entry'}>} Patient_ID) 

/ Count(TOTAL Patient_ID)

 

Or 

Sum({<s*xual_orientation_value = {'No Entry'}>} 1) 

/

Sum(TOTAL <Admission_Program> 1)

JR4
Contributor II
Contributor II

Ah okay, I think the TOTAL is causing the percentage to be ALL admission programs instead of just the current one. Maybe try removing TOTAL and just using this:

COUNT({$<PatientSupp.s*xual_orientation_value={"No Entry"}>} [PATID]) / COUNT([PATID])

It should give you the count of "No Entry" for admission program A over the total count for admission program A only and should do the same for all other admission programs.

DrDanSzuhay
Contributor II
Contributor II
Author

Thank you Chanty4u and JR4. I tried all three formulas and JR4's revised formula works! We also figured out a formula last Friday which is:

Count({<[xtPatientSupp.s*xual_orientation_value]={'No Entry'}>}[PATID]) / (Count({<[xtPatientSupp.s*xual_orientation_value]={'No Entry'}>}[PATID])+Count({<[xtPatientSupp.s*xual_orientation_value]-={'No Entry'}>}[PATID]))

Simply stated the above formula is 

# of No Entry divided by (# of No Entry  plus # with something entered the "-="). 

That worked, but thank you JR4 for providing a more "elegant" formula. Much appreciated. 

Dan