Date Difference¶
The Date Difference task allows you find the difference between two date columns.
Table of Contents
Quick Start¶
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:
Open Data Preparation menu and click on Date Function category
Select Calculate Date Difference option
Choose the Graduated column for option Start date
Choose the Registered column for option End date
Choose Years when choosing the option for Save results as
Enter ‘Years Taken’ in the New 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 following options are supported
Start Date: The date column from which to subtract from.
End Date: The date column which
Save result as: The unit of measure to use when calculating the difference.
Note
The outputs produced are always integers.
The system will round down when doing date difference. Even if the dates are apart by 1 year, 300 days, the system will simply consider the date difference to be just 1 years.