Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
SMiller_FL
Contributor III
Contributor III

between 2 dates when using AddMonths

I got help before on different parts of this but I think this one query is still not quite right.

I need all kids ages 18-21 years old (so 216 months to 252 months). I think I need some sort of ages between and this is giving me all ages greater than 18 and all ages less than 21 but going beyond. The math on the raw data shows a lot less, the formula is showing a large number. Any help is appreciated

Count(distinct {<[Enrollee Date of Birth.autoCalendar.Date]={">=$(=Date(AddMonths(Today(),-216)))<=$(=Date(AddMonths(Today(),-252)))"}>} medicaidID)

1 Solution

Accepted Solutions
Digvijay_Singh

Pl share what do you see at the bottom of expression editor, would like to see how this expression is looking like after $ expansion. Mostly date formatting mismatch between left side and right side could cause trouble. 

View solution in original post

3 Replies
Digvijay_Singh

Pl share what do you see at the bottom of expression editor, would like to see how this expression is looking like after $ expansion. Mostly date formatting mismatch between left side and right side could cause trouble. 

SMiller_FL
Contributor III
Contributor III
Author

The Expression editor says ok. Aah, I did not realize it showed something different here: 

Count(distinct[<[Enrollee Date of Birth.autoCalendar.Date]={">8/16/2004<=8/16/2001"}>}[RecipientNumber-medicaidID])

SMiller_FL
Contributor III
Contributor III
Author

I switched the greater and less than signs and now it works. Thanks!!!