Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
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

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

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