Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
proctors
Creator
Creator

Nesting Set Expression

Hi,

I need to re-use this expression to limit it to only those MRNs where the initial expression is > 1. What we are looking at is how many completed visits we have had per MRN (patient).

=COUNT(DISTINCT {<[Encounter Type]={"OFFICE VISIT", "APPOINTMENT"}, [Appointment Status]={"COMPLETED"}>} VISIT_KEY)/COUNT(DISTINCT {<[Encounter Type]={"OFFICE VISIT"}, [Appointment Status]={"COMPLETED"}>} MRN)

In Laymans, Count the number of Completed office visits for MRNs that have had at least one completed office visits. Divide that by the number of patients.

1 Solution

Accepted Solutions
sunny_talwar

May be this

=COUNT(DISTINCT {<[Encounter Type]={"OFFICE VISIT", "APPOINTMENT"}, [Appointment Status]={"COMPLETED"}, MRN = {"=Count(DISTINCT {<[Appointment Status] = {'COMPLETED'}>} VISIT_KEY) > 1"}>} VISIT_KEY)/COUNT(DISTINCT {<[Encounter Type]={"OFFICE VISIT"}, [Appointment Status]={"COMPLETED"}, MRN = {"=Count(DISTINCT {<[Appointment Status] = {'COMPLETED'}>} VISIT_KEY) > 1"}>} MRN)

View solution in original post

4 Replies
sunny_talwar

Would you be able to elaborate a little more on your requirement? and may be support it with a sample?

proctors
Creator
Creator
Author

Sure. So the current expression works. What I need it to do is to only look at those MRNs that have a Count of Completed Office Visits greater than 1.

Thus in this table below, MRN 222 would not be counted because that patient has had a Count of Completed visits that is only 1 (I want it to look at MRN 999 and 333 because they both have had more than one completed office visit.

   

Encounter TypeAppointment StatusVISIT_KEYMRN
OFFICE VISITCOMPLETED1999
OFFICE VISITCOMPLETED2999
OFFICE VISITCOMPLETED3999
APPOINTMENTNO-SHOW4999
OFFICE VISITCOMPLETED5999
OFFICE VISITCOMPLETED1222
OFFICE VISITCOMPLETED1333
APPOINTMENTNO-SHOW2333
OFFICE VISITCOMPLETED3333
sunny_talwar

May be this

=COUNT(DISTINCT {<[Encounter Type]={"OFFICE VISIT", "APPOINTMENT"}, [Appointment Status]={"COMPLETED"}, MRN = {"=Count(DISTINCT {<[Appointment Status] = {'COMPLETED'}>} VISIT_KEY) > 1"}>} VISIT_KEY)/COUNT(DISTINCT {<[Encounter Type]={"OFFICE VISIT"}, [Appointment Status]={"COMPLETED"}, MRN = {"=Count(DISTINCT {<[Appointment Status] = {'COMPLETED'}>} VISIT_KEY) > 1"}>} MRN)

proctors
Creator
Creator
Author

Great! Works!