Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
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

1 Solution

Accepted Solutions
sunny_talwar

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

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.