Jump to content

Help with Widget Counters - Resolved Today for INC & SRs


dwalby
 Share

Recommended Posts

Hi all,

I'm trying to create a widget counter for 'Number of Incidents Resolved Today' and 'Number of Service Requests Resolved Today'. I can't quite figure out why both widgets are showing the same figure though, see below queries:

Service Request

image.png.efac6c8828d60190b5e2e2ac4b717d61.png

image.png.4e16615f9ae6a29853b8e839497b7324.png

 

Link to comment
Share on other sites

@dwalby because how the logical operator precedence works... you would need to put h_status = ... OR h_status = ... within brackets... or use this instead: h_status IN (''status.resolved', 'status.closed')

image.png

EDIT: you don't need the second brackets... to be more clear your queries would need to be these:

For Incidents:

(h_status = 'status.resolved' OR h_status = 'status.closed') AND h_dateresolved = current_date AND h_requesttype = 'Incident'

For Service Requests:

(h_status = 'status.resolved' OR h_status = 'status.closed') AND h_dateresolved = current_date AND h_requesttype = 'Service Request'

As mentioned above, for the status you can use this criterion as well (which removes the need for any bracket between logical operators):

h_status IN ('status.resolved', 'status.closed') AND h_dateresolved = current_date AND h_requesttype = '...'

 

Link to comment
Share on other sites

@dwalby try this for the resolved date:

h_status IN ('status.resolved', 'status.closed') AND DAY(h_dateresolved) = DAY(NOW()) AND MONTH(h_dateresolved) = MONTH(NOW()) AND YEAR(h_dateresolved) = YEAR(NOW()) AND h_requesttype = '...'

 because we store date and time and you only need the date...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...