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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Nickolay1
Contributor III
Contributor III

Count based on a date condition

Hi all,

I need to create a measure in a bar chart that will count number of batches which correspond to the current month in the column Next 3 months (pls see the file attached). The dimension is not Next 3 three months. Based on this example the result should be 3. I tried this expression: 

Count({<[Next 3 months]={monthstart(today())}>}[Batch Number])

Thanks!

Labels (2)
1 Solution

Accepted Solutions
vinieme12
Champion III
Champion III

Month end has period_no, parameter so AddMonths is redundant

count(distinct {<[Date]={">$(=monthstart(today())) <$(=MonthEnd(today(),3))"}>} [Batch number])

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

View solution in original post

3 Replies
ogster1974
Partner - Master II
Partner - Master II

something like

count(distinct {<[Date]={">$(=monthstart(today())) <$(=AddMonths(monthend(today()),3))"}>} [Batch number])

vinieme12
Champion III
Champion III

Month end has period_no, parameter so AddMonths is redundant

count(distinct {<[Date]={">$(=monthstart(today())) <$(=MonthEnd(today(),3))"}>} [Batch number])

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

Thanks a lot all! It worked 🙂