Comment on page

Working with time

The key concept to understand about working with time in Causal - is Causal's time step index system.
Note that the time step index always start at 0, not 1. So 0 corresponds to the first time step of the model (e.g. Jan'22), 3 corresponds to the fourth time step (Apr'22), and so on.
This time step index allows you to modify variables in formulas, e.g. refer to the value of a variable in three months. See Time modifiers for more.
Causal also has a bunch of in-built helper variables (like date, month, year, today, lastActualDate etc) that make it easy to work with time. See our common formulas on Time Dependent formulas here.

Dates in Causal

The Date function in Causal converts an input in Date format to the appropriate timestep in that model to allow further calculations.
The syntax of the Date function is as follows: either (yyyy,mm,dd) or (yyyy,mm).
E.g. date(2022,12,24) = 11 in a monthly model that starts in Jan 2022.