Skip to main content
Announcements
Qlik Community Office Hours, March 20th. Former Talend Community users, ask your questions live. SIGN UP
cancel
Showing results for 
Search instead for 
Did you mean: 
baylor2016
Creator
Creator

How to get count for a group people age 2-3 by a dynamic date?

Hi Experts,

I am trying to get a count for a group who aged 2-4 days at a given date (user selected). The method I used below does not give me the correct number. Please advise.

= count(DISTINCT   {<

VisitDate=

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

,patientID= {"=Date(V_SELECTED)-Date(DOB)<=4"}

,patientID= {"=Date(V_SELECTED)-Date(DOB)>=2"}

>}patientID)

Thanks

Longmatch

13 Replies
sunny_talwar

This is a search string which either gives a true or a false. This search string is checked for each PatientID and if it returns false, it is excluded. If it returns true, it is included. To see what all is included.... create a new straight table object and add patientID as dimension and use this as expression

=Age(Num(v_selectedDate), Only({<VisitDate = {""$(='>=' & Date(v_selectedDate3YearsAgo) & '<=' & Date(v_selectedDate))""}, YearMonth>}DOB)) >= 50 and

  Age(Num(v_selectedDate), Only({<VisitDate = {""$(='>=' & Date(v_selectedDate3YearsAgo) & '<=' & Date(v_selectedDate))""}, YearMonth>}DOB)) <= 55

Whereever you see -1, those patient IDs are included in your expression.

Does that make sense?

baylor2016
Creator
Creator
Author

Great. I understand now. You are genius. Thank you for your helps as always.

sunny_talwar

No problem at all

baylor2016
Creator
Creator
Author

Hi Sunny,

I posted another question - show the calculated data points in the charts?  I think you will be able to help. Here is the link.

How to show these datapoints in the chart?

Thanks

Longmatch