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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
baylor2016
Creator
Creator

Tricky set analysis question?

Hi,

Here is my question:- Get all the patient visits (before a selected date) for the patients who visited clinic in the previous three days based upon user selected date.  For example, if user selected 1/7/2017, Patient1,2,3,5 had visits between 1/5/2017 and 1/7/2017, I need to get all the visits before 1/7/2017 (not only the visits between  1/5/2017 and 1/7/2017) for these patient.  Right now I can only get the patient visits in the past three days before the selected date by using set analysis (below) in straight table.

=max(

{<

VisitDate=,

VisitDate = {"$(='>=' & Date(V_3DaysAgo) & '<=' & Date(V_SELECTED))"}

>}

VisitDate)

Here V_SELECTED and V_3DaysAgo are the variable I defined.

I created a simple sample attached.

Many thanks!!!

Longmatch

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar
MVP
MVP

Try this

=min(

{<

VisitDate = {"$(='<=' & Date(V_SELECTED))"},

patientID = p({<VisitDate = {"$(='>=' & Date(V_3DaysAgo) & '<=' & Date(V_SELECTED))"}>} patientID)

>}

VisitDate)

View solution in original post

2 Replies
sunny_talwar
MVP
MVP

Try this

=min(

{<

VisitDate = {"$(='<=' & Date(V_SELECTED))"},

patientID = p({<VisitDate = {"$(='>=' & Date(V_3DaysAgo) & '<=' & Date(V_SELECTED))"}>} patientID)

>}

VisitDate)

baylor2016
Creator
Creator
Author

Thank you for the quick response. I do not know p() modifier. It will allow me to do a lot of things.