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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
earlcool
Contributor II
Contributor II

get last date

I have this compound statement I want to add another criteria last date visit (encounterDate).

if there are two dates 2019-06-05 and 2018-07-02 the last date is 2019-06-05.

=Count({<patient_id={"=Age >=18"}>}DISTINCT patient_id)

 

thanks greatly appreciated.

Labels (1)
9 Replies
vinieme12
Champion III
Champion III

=Count({<

patient_id={"=Age >=18"}

,encounterDate={"$(=Date(max(encounterDate)))"}

>}DISTINCT patient_id)

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
earlcool
Contributor II
Contributor II
Author

Thanks for your response,  unfortunately I am getting 0 records when I am sure

that I should get some.

vinieme12
Champion III
Champion III

Can you post a screenshot of the expression editor 

And post some sample data as well, so I have clarity on what your data looks like

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
earlcool
Contributor II
Contributor II
Author

 

 

sreenshot1.PNG

The patients makes a number of visit to different facilities I want the last facility that the patient visisted.

Its hard to explain if you require more information please let me know.

Thanks your help and your professionalism 

vinieme12
Champion III
Champion III

So currently Encounterdate is a timestamp field and not a date field 

You need to remove the timepart from the timestamp , create a new field as below 

For example 

Load facultyname,gender,patient_id

, Encounterdate as encountertimestamp 

,Date(Floor(Encounterdate)) as encounterdate 

From yourdataSource; 

 

 

Then try the same expression again 

=Count({<

patient_id={"=Age >=18"}

,encounterDate={"$(=Date(max(encounterDate)))"}

>}DISTINCT patient_id)

 

 

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
earlcool
Contributor II
Contributor II
Author

I am trying to get something like this put I get zeroI am trying to get something like this put I get zero

earlcool
Contributor II
Contributor II
Author

Data

earlcool
Contributor II
Contributor II
Author

Any help please?

earlcool
Contributor II
Contributor II
Author

I was missing a file