Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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,
Try this
COUNT({<Closed=1, DateUpdated=Today()>} Closed)or on QV8
COUNT(IF(Closed=1 AND DateUpdated=Today(), Closed))
Regards,
Justinas
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,
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
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.
Many thanks for all the replies. Still no joy but have a better understanding so will investiagte further. Many thanks Gerard