Date Difference
The Date Difference task allows you find the difference between two date columns.
Quickstart
Let us start with this data as an example:
Student | Registered | Graduated |
---|---|---|
Alice | 23-April-2012 | 25-April-2015 |
Bob | 24-April-2011 | 26-April-2014 |
Mike | 26-April-2010 | 27-April-2016 |
The goal is to find the time it took for the students to graduate. Complete the following steps:
- Go to
Transform
>Date Function
category. - Select the
Calculate Date Difference
option from the list.
- Next, choose the
Registered
column as theStart date
- Choose the
Graduated
column as theEnd date
- Choose
Years
when choosing the option forSave results as
- Enter
Years Taken
in theNew column name
- Click APPLY
We should end up with something like this:
Student | Registered | Graduated | Years Taken |
---|---|---|---|
Alice | 23-April-2012 | 25-April-2015 | 3 |
Bob | 24-April-2011 | 26-April-2014 | 3 |
Mike | 26-April-2010 | 27-April-2016 | 6 |
Supported Options
The Date Difference function supports the following options:
- Start Date: Refers to the start date column which will get subtracted from the end date column.
- End Date: Refers to the end date column from which the start date column will be subtracted.
- Save result as: Specifies the unit of measurement for the resulting difference column. You can choose a unit starting from 'Seconds' up to 'Years'.
note
- The outputs produced are always integers.
- The system will round down when calculating the date difference. This means, if the dates are apart by say 1 year and 300 days, the system will simply consider the date difference to be just 1 year.
info