Abacum DATEDIFF formula
What's new?
DATEDIFF is a transformation to compute the difference between two dates, especially useful for cohorts use-case.
Why does it matter?
Unlock a new formula to perform critical date calculations directly in the Web App.
How does it work?
Calculates the delta between two dates in days, months, or years.
Start_date: column name where the column is of the type date or number. Can also be a written date or number. End_date: column name where the column is of the type date or number. Can also be a written date or number.
Unit: A string containing one of the following options, always denoted in double or single quotes: “D”, ”M”, or”Y”. The computed delta will be returned in the same unit.
Syntax
DATEDIFF ( start_date, end_date, unit )
Example
DATEDIFF(22/08/2023, current_date, “M”)
// Returns the amount of complete months between 22 August 2023 and the current date column.
DATEDIFF(hire_date, termination_date, “Y”)
// Returns the delta between the hire and termination date in years. If no termination date is present for an employee, a negative value will be returned. This is as empty values are stored as 1970-01-01.
For more information you can check our Academy page