Calculate the duration between two dates and determine whether an event was observed before a specified observation date.
duration
: The time interval between the start and end dates in the specified unit (default: days).observed
: A boolean column indicating whether the event was observed (i.e., if the end date occurs before the observation date).start_date
or end_date
is missing (null), observed
will be false, and duration
will be null.duration
is calculated as the interval between start_date
and end_date
.end_date
is not null, observed
will be true if end_date <= observation_end
; otherwise, it will be false.Examples
ds.first_name
), datasets (ds
or ds[["first_name", "last_name"]]
) or models (referenced
by name e.g. "churn-clf"
).
Inputs
Outputs
step(..., {"param": "value", ...}) -> (output)
.
Parameters
Y
year
Year
years
Years
Q
quarter
Quarter
quarters
Quarters
M
month
Month
months
Months
W
week
Week
weeks
Weeks
D
day
Day
days
Days
h
hour
Hour
hours
Hours
m
minute
Minute
minutes
Minutes
s
second
Second
seconds
Seconds
ms
millisecond
Millisecond
milliseconds
Milliseconds