Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
dezmundw15
Contributor III
Contributor III

Calculate a percentage

I am new to Qlik Sense and I am trying to calculate an allocation percentage.  I am using Qlik Sense and I am utilizing a table.  I have the following column and rows

ProviderFacilityPatients Seen by ClinicPatients Seen by %
Totals200
JennyClinic 1 50
MaryClinic 3100
SuzieClinic 450

I would like to calculate the Patients Seen by Clinic/Provider or 50/200.  I am confused with the Aggr functions and the overall structure of the syntax

Sum(Provider)/ Sum(Patients Seen by Clinic should give me a % across the distribution of patients seen in the clinics...but I am getting nothing.  Can someone help me.

Thanks,

Desmond 

22 Replies
dezmundw15
Contributor III
Contributor III
Author

I tried everyone's suggestions to no avail.  I am wondering if it has something to do with being text.  I am reviewing functions now, to see if I need to somehow convert it.  This is basically an uploaded Excel file put into Qlik.

sunny_talwar

What is your expression for Patients seen by Facility? Is it using Count? Then try this

Count([Patients seen by Clinic] / Count(TOTAL [Patients seen by Clinic])

dezmundw15
Contributor III
Contributor III
Author

Sunny,

Anytime I use the TOTAL fx, it gives me an Error in expression.

sunny_talwar

What is your expression my friend?

dezmundw15
Contributor III
Contributor III
Author

Sunny,

Yes, I am using a Count to get the distribution of patients seen at each clinic.  So for the Patient Seen %, I used the same field, but wanted to get a % instead of a count, to denote as distribution/allocation.

sunny_talwar

Expression please

dezmundw15
Contributor III
Contributor III
Author

This is the actual expression that is being used in the Patients seen by Facility

Count([SEEN BY PROVIDER]) and I get the count which is what is depicted in the screen shot

If I use the following:

Sum([SEEN BY PROVIDER]) - I just get 0.00%

If I use the following:

Sum([SEEN BY PROVIDER])/Sum(Total([SEEN BY PROVIDER]) - I get Error in expression

sunny_talwar

Try this

Count([SEEN BY PROVIDER])/Count(TOTAL [SEEN BY PROVIDER])

dezmundw15
Contributor III
Contributor III
Author

The only way I am getting Total to display in the Table is using the Totals button in the Presentation Tab.  If I turn off, then the total goes away

dezmundw15
Contributor III
Contributor III
Author

OMG....It Worked!!!!

Sunny Thank You so so much!!!