Skip to content

Calculate Date Difference

Description

Calculates the difference in dates between two columns in specified units (years, months, days, hours, etc.) and stores the result in a separate column.

Input

Data only

Output

Transformed Data

Configuration Fields

  1. Start date Date column specifying the start date

  2. End date Date column specifying the end date

  3. Difference units Specifies the user selection for the units of difference required

  4. Output column Name of the column to store the calculated differences

  5. Include original

    • If true Includes the data rows from the previous activity along with the output column.
    • If false Provides only the output column.

Sample Input

idnameenrollmentDatelastAccessdobgraduationDateEnrollment date new
1Alice Johnson2023-01-1501/15/20232002-05-10T00:00:002026-05-1501/15/2023
2Bob Smith15-02-202315-Feb-20232003/04/122027-05-2002/15/2023
3Charlie Brown2023.03.1010 Mar 202310-06-20012025-12-30T23:59:5903/10/2023
4Daisy Adams2023/04/01April 1, 20232000-09-21T12:30:00Z2024/06/1504/01/2023
5Ethan Carter05-May-20232023-05-101999.12.152024-11-0105/05/2023

Sample Configuration

alt text

Sample Output

idnameenrollmentDatelastAccessdobgraduationDateEnrollment date newTotal years
1Alice Johnson2023-01-1501/15/20232002-05-10T00:00:002026-05-1501/15/20233.33
2Bob Smith15-02-202315-Feb-20232003/04/122027-05-2002/15/20234.26
3Charlie Brown2023.03.1010 Mar 202310-06-20012025-12-30T23:59:5903/10/20232.81
4Daisy Adams2023/04/01April 1, 20232000-09-21T12:30:00Z2024/06/1504/01/20231.21
5Ethan Carter05-May-20232023-05-101999.12.152024-11-0105/05/20231.50
6Fiona Green2023-06-20T08:00:00Z20-06-20231998/07/072023/12/31T23:59:59Z06/20/20230.53
7George Hill2023.07.2525th July 20231997-03-032024-10-20T09:30:00+00:0007/25/20231.24
8Hannah Lewis2023-08-1508/15/20231996/11/112024-08-15T16:00:00+00:0008/15/20231.00
9Ian Moore15-09-202315th Sep 20231995-01-012025-07-0109/15/20231.79
10Jenny Owens2023/10/10October 10, 20231994.06.302026-03-15T10:45:0010/10/20232.43