Skip to main content
Skip table of contents

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(NodeLevel , BasenodeBasevalue)

Parameters

  • Node: Input node, of which the previous year value is taken (e.g. 'Cost')
  • Level: The time level which defines the previous value (e.g. "Year" → previous of "2016" is "2015")
  • Basenode: Input Node which is used to get the value of the Node for the base period (e.g. 'Initial Cost')
  • Basevalue: The value describing the base period (e.g. "2015")
Limitations

When using the PREVIOUS function, the following limitations apply to all nodes between Node and Basenode

  • no manipulation of time, e.g. 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

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

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.