Home > Working with Planning Projects > Building an Application > Building Application Models > Building A Cube Model > Measure Settings > Measure Logic Functions > PREVIOUS function
PREVIOUS function Last Updated 12/21/2008 5:34 PM
The PREVIOUS function has 2 forms:
- Previous ('MEASURE')
- Previous ('MEASURE', 'PERIOD NO')
where:
MEASURE is the measure name you are referencing.
PERIOD NO is the column number of the model you wish to refer to.
For the first form, reference will be to the previous period or current period minus 1.
For the second form, reference will be lagged by the value in PERIOD NO, or current period - PERIOD NO.
In both cases, the PREVIOUS function will skip any calculated columns.
EXAMPLES
1. The following is an example of using the PREVIOUS function to calculate a cumulative cash flow which we then use to calculate a Net Cash balance for each period.
ASSUME WE HAVE THE FOLLOWING MEASURES:
'OPENING CASH BALANCE' 'CASH IN' 'CASH OUT' 'CUMULATIVE CASH' 'CLOSING CASH BALANCE'
WE COULD APPLY THE FOLLOWING CALCULATIONS TO ACHIEVE THE DESIRED RESULT:
'CUMULATIVE CASH' = previous('Cumulative Cash') + 'Cash In' - 'Cash Out' 'CLOSING CASH BALANCE' = 'Opening Cash Balance' [1] - Cumulative Cash'
See Also SUM function MAX function MIN function DEPRECIATION function INT function ROUND function ROUNDUP function ROUNDDOWN function IF Function SWITCH Function
|