PREVIOUS
Basic Overview
The previous function is almost never necessary and has considerable performance and usability disadvantages over the ROLLFORWARD function. Its usage is not advised, unless you absolutely must - contact the Valsight support for information on your specific problem to evaluate if it can be modelled with a ROLLFORWARD instead.
Description | Returns the previous period value of a Node, except for the base-period Basevalue where it returns the value of the Base Node. All effects applied between the Node and the Basenode will therefore cumulate over the year. The function can be used to create models where the value of a node depends on the result for the previous period of a node higher in the value driver tree, thereby creating a loop that is resolved along the time dimension. An example is provided below, where the 'Base Cost' node depends on the final 'Cost' of the previous year, calculating the costs based on the costs of the previous year with the two drives inflation and productivity. |
Signature | PREVIOUS(Node, Level , Basenode, Basevalue) |
Parameters |
|
Limitations | When using the PREVIOUS function, the following limitations apply to all nodes between Node and Basenode
|
Example
Input Initial Cost
Year | Cost |
2015 | 100 |
Productivity Change
Year | Productivity Change |
2015 | 0% |
2016 | 20% |
2017 | 20% |
2018 | 20% |
Cost Inflation
Year | Cost Inflation |
2015 | 0% |
2016 | 10% |
2017 | 10% |
2018 | 10% |
Output Base Cost = PREVIOUS('Cost', "Year", 'Initial Cost', "2015")
Year | Cost |
2015 | 100 |
2016 | 100 |
2017 | 130 |
2018 | 169 |
Cost = 'Base Cost' * (EXPAND(1,"Year") + 'Cost Inflation' + 'Productivity Change')
Year | Cost |
2015 | 100 |
2016 | 130 |
2017 | 169 |
2018 | 219.7 |