PREVIOUS
Category: Rollforward & time series
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.
Overview
Description | Returns the previous period value of a node, except for the base period where it returns the value of the base node. All effects applied between the node and the base node 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 Use when you need loop-style logic with a defined base case rather than a simple previous-period comparison. |
Syntax |
|
Parameters |
|
Limitations | When using the PREVIOUS function, the following limitations apply to all nodes between
|
Examples
Loop Logic with an Explicit Base Period
This example shows how PREVIOUS creates a loop along the time dimension by taking the prior year's result and using a fixed base period to start the calculation.
Input node: 'Initial Cost'
Year | Cost |
|---|---|
2025 | 100 |
Input node: 'Productivity Change'
Year | Productivity Change |
|---|---|
2025 | 0% |
2026 | 20% |
2027 | 20% |
2028 | 20% |
Input node: 'Cost Inflation'
Year | Cost Inflation |
|---|---|
2025 | 0% |
2026 | 10% |
2027 | 10% |
2028 | 10% |
Formula: PREVIOUS('Cost', "Year", 'Initial Cost', "2025")
Year | → PREVIOUS Result |
|---|---|
2025 | 100 |
2026 | 100 |
2027 | 130 |
2028 | 169 |
Formula: 'Base Cost' * (EXPAND(1, "Year") + 'Cost Inflation' + 'Productivity Change')
Year | Cost |
|---|---|
2025 | 100 |
2026 | 130 |
2027 | 169 |
2028 | 219.7 |
Related Functions
Function | When to use instead |
When the same logic should be modelled in a more modern and performant way instead of relying on PREVIOUS loop logic. | |
When you only need a simple previous-year reference instead of loop-style logic with an explicit base case. |