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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
jbchurchill
Creator
Creator

Set Expression comparing date fields with Count is not working

I have this expression based on a calculated field (expdate) but it isn't working. I want to count records that have expired. Instead this is just showing me all records in the dataset. I expected that expiration dates that have not occurred yet (there are several) would be excluded from this count. Is the syntax here correct at least (I suspect I need to do something w/ the date formats perhaps)?

=Count({<[expdate]={"<=$(Today())"}>}[service_id])

Labels (1)
1 Solution

Accepted Solutions
Saravanan_Desingh
MVP
MVP

Try one of these,

=Count({<[expdate]={"<=$(=Today())"}>}[service_id])
=Count({<[expdate]={"=Date([expdate])<=$(=Today())"}>}[service_id])
=Count({<[expdate]={"=Date([expdate])<=Today()"}>}[service_id])

View solution in original post

2 Replies
Saravanan_Desingh
MVP
MVP

Try one of these,

=Count({<[expdate]={"<=$(=Today())"}>}[service_id])
=Count({<[expdate]={"=Date([expdate])<=$(=Today())"}>}[service_id])
=Count({<[expdate]={"=Date([expdate])<=Today()"}>}[service_id])
jbchurchill
Creator
Creator
Author

I actually used the top one but ended up taking the "=" out (I was just confused about what I wanted). Thanks for your assistance!

=Count({<[expdate]={"<$(=Today())"}>}[service_id])

That did the trick