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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
nira
Contributor III
Contributor III

Set Analysis

Hi,

This is my current expression used to calculate the percent of total cases for patients living outside the current region selected.

=Num(count({<patient_region-={'$(vCurrentRegion)'}>}patient_id)/COUNT(TOTAL {< patient_region-={'$(vCurrentRegion)'}, patient_province , admission_category, patient_region>} patient_id),'#,##0%')

in the set analysis used for the COUNT TOTAL expression, i included patient_region twice. This is because i still want it to calculate the total cases for outside the current region selected, however, i also want the kpi to ignore the patient region filteri have in the dashboard. Since i am trying to use the same field (patient_region) twice in the set analysis, it is not working. How can i fix this?

nira_0-1644585813032.png

 

 

3 Replies
hic
Former Employee
Former Employee

I think you should use 

Num(
Count({<patient_region=E(patient_region)>} distinct patient_id)/
Count({<patient_region= >} distinct total patient_id),
'0%'
)

I made some mock-up data, and selected region=B:

Henric_Cronstrm_0-1644591790973.png

As you can see, the second measure (third column) correctly picks up number of patient_ids from regions outside current selection. And the last column calculates the percentages.

nira
Contributor III
Contributor III
Author

What does {<patient_region=E(patient_region)>} translate to? 

This doesn't seem to produce any results. Don't I still need to add this in the set analysis: {<patient_region-={'$(vCurrentRegion)'}>}? the variable vCurrentRegion corresponds to =only(facility_region) which is the region of the hospital selected.

nira
Contributor III
Contributor III
Author

This is working, however, when i filter the sheet by a patient_region, the % does not change.

=Num(
Count({<patient_region=E(facility_region)>} distinct patient_id)/
Count({<patient_region=E(facility_region), patient_province >} distinct total patient_id),
'0%'
)