ROLLFWD() function

For rolling balances along time

🗒️ Description

The roll forward function takes a ‘closing’ value for a defined indicator from the previous period, and carries that value forward into the next period. 


It is designed to allow time-spiralling behaviour often seen in values that represent balance numbers over time (eg cash balance, or employee headcount).


The roll forward function will be calculated period by period, so that it does not create a circular reference.

For other formulas that you try to write within Blox the system will check to make sure you didn't create a circular reference, and it will alert you if you do. The rollfwd is an exception to this because we are rolling a balance from one period to the next.


The intended use of this function is as the “Opening balance” or “Carried / forward” balance.


The starting value is an Optional argument for when you want to add a starting value in the first period of the time dimension - e.g. Opening cash balance, Opening customer count etc

✏️ Syntax & variables

rollfwd( “<indicator name>” , <starting value>)

  • “indicator name” : string. Name of the indicator to roll forward a period - Must be another indicator in the same block
  • starting value (optional) : number (float) or string. Value to start with in the first period. Defaults to 0 if nothing is passed, Can also reference another indicator that contains a number to use as the opening balance.

✅ Expected result & examples

With no starting value - starting at 0

Indicator Formula Jan Feb Mar
Opening balance rollfwd('Closing balance') 0 500 1100
Cash in Input 1000 1200 1600
Cash out Input 500 600 700
Closing balance “Opening balance” + “Cash In” - “Cash Out” 500 1100 2000