Comment on page

Time modifiers

Time modifiers allow you to reference various different time instances of a variable. This is where Working with time comes in -- so it's worth giving that a read if you haven't already


Current - returns current value of that variable
Previous - returns the previous value of that variable, relative to the time step in which the formula is being applied. For example, in June, Customers[previous] corresponds to the the value of "Customers" in May.
By default, when you reference another variable, Causal will return the Current value of that variable. When you reference the variable itself, Causal will return the Previous value of that variable.
Look-back & look-forward - returns the value of that variable x days/weeks/months/years in the past or future, from "t" (the current time step). For example, if you want Causal to return the value 12 months ago, your time modifier would be "t-12". Conversely, if you wanted to return the value three months in the future, your time modifier would be "t+3".
In a look-back or look-forward, we may reference dates that are before the start, or after the end of a model's date range. These cells will evaluate to the empty value of the variable (ie., either 0, or the none value).


Final - returns the value of the final timestep of the model for that variable. Note that if you extend your model time settings, any variables referencing the final time step will auto-update.
Absolute - returns the value of a single, particular timestep for that variable. e.g. 1 refers to the 2nd time step of the model, 0 refers to the 1st time step of the model etc. You can also just type in date(YYYY,MM) instead of the time step index number.


Spans are a sequence of time steps, e.g. past six months in a monthly model would be t-6:t-1
Note: spans always need to be aggregated, e.g. sum or avg.
All - returns the sum of all time steps for a variable.
Span with a custom start/end-point - for example:
  • First 6 days/weeks/months/years of your model: 0:5 (absolute)
  • Past three days/weeks/months/years (relative, useful for rolling averages)