The Date Difference task allows you find the difference between two date columns.
Let us start with this data as an example:
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:
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.
- 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.
The result column documentation