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

Announcements
Share your agentic AI experience, learn from others, and earn a new badge: Put Agentic AI to Work
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sum And Today (2)

Hi there,

I have a field Called Closed. To calculate the number of closed calls I use SUM(IF(Closed,1,1)) However how would i get the Expression to only look at items that have been closed today?

The field that controls the date is DateUdpated, is it possible to get the expression to only show those calls that have been closed today without applying a separate filter?

Many thanks

Gerard



Labels (1)
6 Replies
vgutkovsky
Master II
Master II

Sure, just do it like this: sum(if(Closed and date(DateUpdated)=today(),1)). This also encloses the DateUpdate in a date() function to make sure it compares the dates in the proper format.

Regards,

justinasp
Creator
Creator

Try this

COUNT({<Closed=1, DateUpdated=Today()>} Closed)


or on QV8

COUNT(IF(Closed=1 AND DateUpdated=Today(), Closed))


Regards,

Justinas

vgutkovsky
Master II
Master II

Not a bad idea if you want to calculate on the fly--my previous post assumes that the calculation will occur in the script.

Regards,

Not applicable
Author

Thanks for the quick reply. I am usign qlikview 9. The sum of closed isnt performed in the script.

Using the above it is unable to locate the field Today?

Many thanks

Gerard

johnw
Champion III
Champion III

Yeah, I believe that syntax only works with fields. Today() isn't a field, so it failed. I think you need this:

count({<Closed={1}, DateUpdated={'$(=today())'}>} Closed)

You might also need to wrap today() in a date() function to match the format of DateUpdated. QlikView isn't smart enough to do a date comparison here, and is doing something closer to a text comparison.

Not applicable
Author

Many thanks for all the replies. Still no joy but have a better understanding so will investiagte further. Many thanks Gerard