ROLLFWD() function

For rolling balances along time

Simon Ritchie

Last Update hace 2 meses

šŸ—’ļø 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
FebMar
Opening balance
rollfwd('Closing balance')05001100
Cash in
Input100012001600
Cash out
Input500600700
Closing balance
ā€œOpening balanceā€ + ā€œCash Inā€ - ā€œCash Outā€
50011002000

Was this article helpful?

0 out of 0 liked this article