Want report on average duration to show in hours

Goran WitchDoc
ServiceNow Employee
ServiceNow Employee

I wonder if it is possible to make the vertical line here in hours instead of "days". I have put the attribute "max_unit=hours" on the field so when looking on an incident the task sla show the duration in hours, like 34 hours.

But then I put a report on the vaules, I still get that in "days"...

Like this:

sla hours 2.GIF

I rather have it in ours like: 27hours, 56hours etc...

Hoping that there are a settting or something simular so I don't have to make a own field and the the vaule there in hours and then do the average on that field.

1 ACCEPTED SOLUTION

Yea,



Not with the oob things. I hade to create a own field that I called Business elapsed in hours.



I then in the calculated value put the code to recount the time into hours.


It looks like this:


report hours 2.PNG



Then I use that field instead in the report and get something like this:



report hours.PNG




Hope this will help you. Let me know if you got any other questions or ideas.



//Göran


View solution in original post

14 REPLIES 14

I think if you're using Performance Analytics you don't need a new field based on this thread;


Sum of Duration fields


Hi Goran,


I followed your instructions but when I ran the report I getting   the 0 values in the business_in_hours field I created. It seems I am doing something wrong.


Could you please advice me?, here what I did..


First I created the field:


find_real_file.png


Then I modified the report to use that field:


find_real_file.png


And this is the Result:


find_real_file.png





This is the original Report that I need to express in hours:


find_real_file.png



Hi luislembertsantos,



This is probably since the value isn't put there until you query the records. So if you list all the records, it will recalculate to the right value. This is to fix the "history" records. The ones that are created afterwards, will have a value.



But I didn't know this when I wrote this post, but calculated value can have a major performance issue. I wrote a blog about it here: Calculated value, a pot of gold at the end of the rainbow or a devil in disguise?



I Depending on your requirements, I would either have a BR that sets this value when the record is closed, or if you need to do it on open records, perhaps have a schedule job or similar that does it once a day or how often you need it.



//Göran


Hi,


I followed your advices but I'm getting the same. But One thing when I change the report to a List I see the values for the calculated field I created dev_sctual_in_hours I can Count those records but I CAN'T Sum them.




Using Count:





Using Sum:







Did you ever find an answer for this? I too only get a straight line when using this field as Aggregated field, but when using Duration/Business duration, it shows the line beautifully.