The CreatorCon Call for Content is officially open! Get started here.

Performance analytics report to calculate duration between to fields

robertmueller
Giga Contributor

Hi,

Can someone advise the script needed in Performance Analytics to calculate the duration between two fields. For example I would like to calculate the duration between when the incident was opened and when it was assigned to someone.

 

Thank you in advance.

1 ACCEPTED SOLUTION

Adam Stout
ServiceNow Employee
ServiceNow Employee

For time to assignment metrics, I prefer leveraging an SLA since this will allow me to easily calculate business time in addition to absolute time.  Reporting on SLAs is then pretty straight-forward.

If you don't go down this path, you need a Performance Analytics script to perform this calculation per row.  This cannot be done in a Formula since they operate on aggregates.

There should be examples available OOTB based on resolved time.  Just be sure to handle unassigned tasks as well (with score_start) or exclude them from your indicator.  This is the primary use case for Performance Analytics scripts and can also be found in the docs:  https://docs.servicenow.com/csh?version=latest&topicname=pa-scripts

 

View solution in original post

17 REPLIES 17

Kumar116
Tera Contributor

its already available OOB in Metric table. you can create your report using this

Hi,

I am aware that both the fields and their time stamps are on the metric table but how do you calculate the difference in a report.

Difference reflects in field named as Duration. for creating report from this, database view needs to be created from Incident, metric instance & definition. Report can be created then by using duration field. 

you can look for OOB db view for this.

I am in reporting not application support so can not create new fields in the system, hence the question of how to calculate the difference within performance analytic reports.