Date Difference

In CRM Analytics, calculate the duration between two selected date columns as days, months, or years.

Required Editions

Date Difference

User Permissions Needed
To create a recipe: Edit CRM Analytics Dataflows OR Edit Dataset Recipes
  1. In a Transform node of a Data Prep recipe, select one date column in the Preview tab.
  2. Select the Formula button (Formula button) in the Transform toolbar.
  3. Select Date Difference.
  4. Configure the transformation.
    The Duration menu appears when you select Date Difference.
    1. Start Date is automatically filled with the date column you previously chose. Cancel and restart to choose a different Start Date.
    2. End Date is the value used to calculate the duration from the start date. Choose a date column from your data or the Now option to use the current date and time.
    3. Select whether to return duration as days, months, or years. Days are rounded up to the nearest value, while months and years include the selected number of decimal places.
  5. Optionally, change the label of the column that stores the result in the Column Label field.
  6. Click Apply to add the transformation to the Transform node.

    The Preview tab shows the new Now column.

    Preview shows the new Duration column.
  7. To view the Graph area, click the Collapse button (Collapse button).
  8. Save the recipe.

After you run the recipe, you can view the calculated duration. The Now option uses the date and time when the recipe last ran, based on UTC timezone.