Description
Previous is an iterative computation that allows filling the cells with the previous value following a specific Dimension (generally a time Dimension).
The function references another cell of the same Metric previously computed by the same formula or the user input when the override is activated.
Syntax
PREVIOUS(Dimension, [Offset])
-
Dimension
of the current Metric on which we would like to apply an offset -
Offset
is an integer N that allows to return the Nth value before. By default the value is 1
Return type
Same as Metric
Examples
Example 1
![](https://uploads-eu-west-1.insided.com/pigment-en/attachment/dff3591a-be97-48bf-8fab-5567c7e88729.png)
![](https://uploads-eu-west-1.insided.com/pigment-en/attachment/59ad2091-87c6-4b50-a0ea-f5cdfdf7c903.png)
Example 2
Using the Annual Rise Property of the Product Dimension and initial price for a specific year, Previous function allows us to calculate Product annual price.
![](https://uploads-eu-west-1.insided.com/pigment-en/attachment/bdf36bd2-7e59-4ab9-a554-a94949362a72.png)
Product price with inputed values for FY20:
![](https://uploads-eu-west-1.insided.com/pigment-en/attachment/fa80b048-a3e1-4e62-a794-aa3c4657a044.png)
The formula calculates all the following values for FY21 and FY22:
![](https://uploads-eu-west-1.insided.com/pigment-en/attachment/3964a002-5bf9-48ef-a6c5-b069c36406c1.png)
For more examples, check