Exporting Time Worked Value to Excel

cybermom302003
Kilo Explorer

I am running a report off the Incident table with the field Time Worked included. When I generate the report, I get an accurate calculcation of total time worked per Incident. However, when I export to Excel, the total is something completely meaningless. For example Time Worked should be "13 seconds" and it shows up in Excel as just "786".

I can export just fine if I run the report directly from the Time_worked table, however I need to be able to run the report against a field that cannot be accessed from the Task table.

Any ideas??

1 REPLY 1

skaufmann
ServiceNow Employee
ServiceNow Employee

It's actually not meaningless just not readable by humans 🙂

The value exported to excel is in milliseconds. I had the same problem and instead of having the billing department learn how to calculate milliseconds to whatever you want, I created a new field that is not visible in the form but is used in the reports/exports instead of the one you are using.

When you create the new filed (I used "Time Worked in Hours") set the calculation to:


current.time_worked.dateNumericValue()/3600000

(replace "time_worked" in the calculation above with the element value of the time worked field in the incident)

This will take the milliseconds and convert to hours with a decimal and save it in the database as this new value. Make sure the new filed you create is "decimal". in your export/reports, make sure to use the "Time worked in Hours" filed to get the proper data.

Hope this helps.