Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

philmywallet
Not applicable

Percentage By Dimension & Set Analysis


I am trying to show a percentage by dimension.  for all patient appointments.  This works using the following :

(

Count(patient_id)) / (Count(TOTAL <appointment_month> patient_id))

The issue I have is that I only want to include any records which have a AppointmentReason = 'Health'

How do I update the expression to include the set analysis also?

Regards

Phil

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Not applicable

Re: Percentage By Dimension & Set Analysis

Count({<AppointmentReason = {'Health'}>}patient_id) / Count({<AppointmentReason = {'Health'}>}TOTAL <appointment_month> patient_id)


talk is cheap, supply exceeds demand
3 Replies
Gysbert_Wassenaar
Not applicable

Re: Percentage By Dimension & Set Analysis

Count({<AppointmentReason = {'Health'}>}patient_id) / Count({<AppointmentReason = {'Health'}>}TOTAL <appointment_month> patient_id)


talk is cheap, supply exceeds demand
venkatasreekant
Not applicable

Re: Percentage By Dimension & Set Analysis

Hi try like this

If Condition

=Count(distinct If(AppointmentReason = 'Health',Patient_Id)) / Count(Total If(MonthName = appointment_month,Patient_Id))

Set Analysis:

Count({<AppointmentReason = {'Health'}>}patient_id) / Count({<AppointmentReason = {'Health'}>}TOTAL <appointment_month> patient_id)

philmywallet
Not applicable

Re: Percentage By Dimension & Set Analysis

Worked a treat.  Thanks