How to calculate average of time

Vasanth Pandia1
Tera Contributor

Hi All,

I have a requirement to calculate "Average time spent for a request from when the record was created until the request is accepted or rejected".

Please let me know how to calculate the average time, I need to use this in Performance Analytics.

 

Regards,

Vasanth

1 ACCEPTED SOLUTION

Vasanth, this is exactly what metrics is for. You need to configure a metric on the request table for field duration on the state field, and then you can configure an indicator in PA to collect the durations of those metrics, doing whatever calculations you want on them. (For an average, you'd divide the sum of all of the times collected by the number of records collected.)

 

You have to understand that PA by itself can't go back in time to figure out when something happened if the timestamps of those events aren't recorded; it can only do calculations based on the current state of records as of the time the collector runs. If you want historical data, you have to record that data in some way, which means you're going to have to either record a timestamp on the records themselves or use metrics to collect the data that can be rolled up in PA.

View solution in original post

10 REPLIES 10

Ashutosh Munot1
Kilo Patron
Kilo Patron

Hi,

 

How you decide it is accepted or rejected? Via Approvals?


Thanks,

Ashutosh Munot

 

Please Hit Correct, ️Helpful depending on the impact of the response 

Adam Stout
ServiceNow Employee
ServiceNow Employee

Do you have a timestamp on the record that records when it is accepted or rejected?  That may be a good idea to add to make this simple.  If not, you'll need to configure some metrics to help you here.  Then PA will be run on top of that.

Dennis R
Tera Guru

I would suggest adding a field to your request and using a business rule to timestamp it when the approval is processed (accepted or rejected).

 

Then coming up with an average time is pretty simple, just create two automated indicators; one for the number of processed requests (requests which have the approval processing time field set to some non-null value), and one for the total time it took to process the approvals for each request (the sum of the processing timestamp - created timestamp fields). Then create a formula indicator that divides the latter by the former to get the average.

Vasanth Pandia1
Tera Contributor

Thanks everyone. I will try out these ways and reach out to you, If I face any difficulties.

 

Regards,

Vasanth