Reference Updated March 27, 2026

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 '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 drivers inflation and productivity.

Use when you need loop-style logic with a defined base case rather than a simple previous-period comparison.

Syntax

`PREVIOUS('Node', "Level", 'BaseNode', "BaseValue")`

Parameters

  • Node: Input node of which the previous period value is taken, for example 'Cost'.

  • Level: The time level that defines the previous value, for example "Year" where the previous of "2026" is "2025".

  • BaseNode: Input node that is used to get the value of the node for the base period, for example 'Initial Cost'.

  • BaseValue: The value describing the base period, for example "2025".

Limitations

When using the PREVIOUS function, the following limitations apply to all nodes between 'Node' and 'BaseNode':

  • No manipulation of time, for example by using SHIFT.

  • All nodes must have the time level used for the loop.

  • 'Node' and 'BaseNode' must have the same levels.

  • The loop cannot span multiple sub-models.


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'

YearCost
2025100

Input node: 'Productivity Change'

YearProductivity Change
20250%
202620%
202720%
202820%

Input node: 'Cost Inflation'

YearCost Inflation
20250%
202610%
202710%
202810%

Formula: PREVIOUS('Cost', "Year", 'Initial Cost', "2025")

Year→ PREVIOUS Result
2025100
2026100
2027130
2028169

Formula: 'Base Cost' * (EXPAND(1, “Year”) + 'Cost Inflation' + 'Productivity Change')

YearCost
2025100
2026130
2027169
2028219.7

FunctionWhen to use instead
ROLLFORWARDWhen the same logic should be modelled in a more modern and performant way instead of relying on PREVIOUS loop logic.
PYWhen you only need a simple previous-year reference instead of loop-style logic with an explicit base case.
Was this page helpful?