is now

Calculating the Cycle Time of a Deal

Last update: June 27, 2025

Picture of Corey Wilson
Corey Wilson

Technical Writer

In this article:

Let’s create a Calculated Field that calculates the Cycle Time of a Deal

Note: The App you create this Calculated Field in can vary based on your Servis.ai setup. We are using the Deals App for our example but a Leads or Projects App works just as well.

To begin we will need the following fields in the Deals App:

  •  Start Date- A Date Field that contains the date the deal record was created.
  •  Close Date- A Date Field that contains the date the deal record was marked as Closed.

See How to create a new form field for more. 

Begin by naming the Calculated Field and selecting what Section of the Deals App the Calculated Field will be displayed in (the choices will depend on your setup).

Next, click the Show Advanced Settings box and change the Calculated field to Yes

Now, select script Calculation Type. Enter the following code snippet into the Script window:

(function(deal){

var StartDate = Date.parse(deal.created);

var EndDate = Date.parse(deal.closeDate);

if(!EndDate){

return 0;

}
var timeBetween = EndDate - StartDate;

var days = timeBetween / (24 * 60 * 60 * 1000);

var justDays = parseInt(days);

return justDays;

}(deal));

🙄

😐

😊

😍

Welcome to servis.ai Free Edition

Link your email to begin

Continue with Google

Continue with Microsoft

By continuing, you agree to servis.ai Terms of Use. Read our Privacy Policy.

Get Started with servis.ai

30-minute demo where you see servis.ai in action.

Unlock the essential servis.ai features at no cost.

How can I be of servis?
How can I be of servis?