Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
dezmundw15
New 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

Re: Calculate a percentage

May be this

Sum(Provider)/Sum(TOTAL Provider)

dezmundw15
New Contributor III

Re: Calculate a percentage

Sunny,

Thanks for getting back to my ask...I tried that very same function and it come back with nothing ( - ).  I think it has something to do with the Qlik table calculating the "Patients Seen by Clinic"column is summarized based on the Provider column.  In the Data Section under Column (Provider) the function is calculating as =[Provider].  The summarized results is based on this column. 

I have received results calculating the %, but it would read as follows: 200000%, 50000%, 100000% and so on. 

dezmundw15
New Contributor III

Re: Calculate a percentage

Sunny,

I have used the following as well, and I just get 0% for everything

sum([PROVIDER])/textcount([PROVIDER])

Re: Calculate a percentage

Would you be able to share a sample or an image to show what you have?

MVP & Luminary
MVP & Luminary

Re: Calculate a percentage

Sunny,

I think you meant:

Dimensions:

Provider

Facility

Measure:

Sum([Patients seen by Clinic] / Sum(TOTAL [Patients seen by Clinic]


-Rob

http://masterssummit.com

http://qlikviewcookbook.com

Re: Calculate a percentage

Yes you are right

pradosh_thakur
Honored Contributor II

Re: Calculate a percentage

may be something like this

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


please check your field name as this may contain  extra space .


or

Sum([Patients seen by Clinic] / Sum({1} [Patients seen by Clinic]) 

regards

Pradosh

Learning never stops.
dezmundw15
New Contributor III

Re: Calculate a percentage

Sunny here is a screen shot

SnipItDoc.PNG

Re: Calculate a percentage

Did you try with Rob's expression

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