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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
laf4t
Contributor II
Contributor II

Count Max Dates greater than today

I have a little problem, I am trying to count max date greater than today in qliksense using an expression and I haven't been able to figure it out. What I have is 

 

=COUNT (DISTINCT Aggr(IF(Max([SalesDate]) > today(),[SalesDate]) ,[SalesDate]))

but this definitely is not giving me the accurate count. Help!!

Labels (1)
1 Solution

Accepted Solutions
laf4t
Contributor II
Contributor II
Author

I was able to tweak what you gave and this worked for me


Count({$<[Sales Date] = {">=$(=Date(Today(), 'YYYY-MM-DD'))"}>} distinct[Client ID])

 

Thanks everyone

View solution in original post

7 Replies
Taoufiq_Zarra
MVP
MVP

If i understood correctly may be this :

=count({<SalesDate={">$(=date(today()))"}>} distinct SalesDate)
Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
laf4t
Contributor II
Contributor II
Author

Thanks but that didn't work, it came back as 0. 

I've also tried this 


=COUNT (DISTINCT Aggr(IF(Max([SalesDate]) > today(),[SalesDate]) ,[SalesDate]))

but it gave me the wrong # of counts, returned 56 instead of 79 .. not sure where I am going wrong.

 

 

 

Taoufiq_Zarra
MVP
MVP

can you share a sample data ?

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
laf4t
Contributor II
Contributor II
Author

2020-06-11_0-53-13.jpg

this is a sample data, I'm trying to count the max([salesdate]) > today()  ...

Help!!!

Taoufiq_Zarra
MVP
MVP

the formula already sent is correct unless you have some other info to share, otherwise:

=count({<[Sales Date]={">$(=date(today()))"}>} distinct [Sales Date])

 

output :

3=6/12,6/13 and 6/14

Capture.JPG

verify also that : SET DateFormat='M/D/YYYY';

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
laf4t
Contributor II
Contributor II
Author

Still not working for me for my version of Qlik, keeps returning 0

laf4t
Contributor II
Contributor II
Author

I was able to tweak what you gave and this worked for me


Count({$<[Sales Date] = {">=$(=Date(Today(), 'YYYY-MM-DD'))"}>} distinct[Client ID])

 

Thanks everyone