Duration field value not displaying properly in reporting

jomandy
Kilo Explorer

I have created a new field on the Incident table with a type Duration to calculate the age of open incidents (datediff from opened to today). The calculation works and the field displays correctly on the incident form, however I am not able to report off of this field correctly.

First - if I create a list report I see the values (eg. 2 days 11 hours and 29 minutes) but I can't sort this column. I can sort other duration columns, like Business Duration, that display the data in the same format.

Second - If I create a chart report it automatically tries to group the duration in Report Ranges but doesn't recognize the amount of time. So I get a bar chart with all the incidents in the 'empty' column and all the ranges (same day, 2-5 days, etc) have a count of 0.

I believe this is linked to a formatting issue but I've had no luck finding anything online.

Any help is much appreciated, and please let me know if you need additional details.

8 REPLIES 8

chaselong
Mega Expert

Did you ever find any answers on this? I'm running into a similar problem. I am trying to create a duration field to report off of for catalog tasks, since there doesn't appear to be one OOB. I created a new duration field and set it to calculate the difference between the open time and close time. It works and displays the correct values on list views and forms, but it's almost as if ServiceNow doesn't actually recognize that value. If I filter by field is not empty, I get no results. If I report off the field nothing is returned. Oddly enough I have noticed this seems to be a retroactive problem. On tasks closed since I created the field I can report off of the field.


Hi Chase,



Have you tried creating report from the list view.i think this should solve the sorting issue.



Arun


Well my issue isn't really the sorting. My issue is the field doesn't seem to "really" be populating. For example on incidents I have a single score report that takes the average duration of incidents. Using interactive filters individual managers can look at the average duration of their groups incidents and compare them month to month. If I run a single score report on the average duration field I created it returns 0, but if I go look at the field for closed tasks in the catalog tasks list view it displays the proper duration. It's like the new field isn't actually populated, but is just being calculated on display.


ArunKRam
Giga Expert

i think the issue is with the dynamic nature of the content of the field. its changing often and the system is not able to capture the value.Can you send me the code you are using to calculate the duration?