The PREVIOUS function evaluates an expression based on the preceding value across the selected dimension.

For example, you can use this function to compare the values of each period relative to the previous period.

PREVIOUS(Expression [, List])

ArgumentData typeDescription
ExpressionNumber, Boolean, date, time period, list, or textThe expression to return the value from the previous period for.
List (Polaris only)List

The list over which the function should operate. The target line item must be dimensioned with any dimension compatible with this list.

See Calculation engine functionality differences.

The PREVIOUS function returns a result of the same data type as the Expression argument.

  • In Polaris, you can't use PREVIOUS for line items that have the Formula summary method. In the Classic Engine, you can.
  • In Polaris, you can use PREVIOUS with any dimension compatible with a dimension of the target, except Versions. For example you can use a list or its subset as the second argument when the target line item is dimensioned by a list. For versions, use PREVIOUSVERSION. In the Classic Engine, you can use PREVIOUS only with a time dimension.
  • In Polaris, for time outside the time range hierarchy, PREVIOUS returns zero or blank values.

PREVIOUS(Revenue)

This formula returns the preceding value of the Revenue line item.

PREVIOUS(Lead count, Sales stage order)

This formula looks up the lead count from the previous stage in the Sales stage order list.

If the PREVIOUS function returns a value from outside a line item's time range, it uses a default value. If the line item has a data type of:

  • Number, PREVIOUS returns a value of 0.
  • Boolean, PREVIOUS returns a value of FALSE.
  • Text, date, or time period, PREVIOUS returns a value of BLANK.

When you apply Brought-Forward to a line item, the PREVIOUS function includes it as an additional period before the first time period in a module. However, as there is no value before the Brought-Forward period itself, the PREVIOUS function returns the default value for the Brought-Forward period.

In Polaris, the target line item can be of any dimension compatible with the second argument List. In the Classic Engine, the target line item must have Time as a dimension.


Jan 21Feb 21Mar 21Apr 21
Net Profit215,770221,123223,495220,129

Month-on-month profit change

Net Profit - PREVIOUS(Net Profit)

215,7705,3532,372-3,366

In this example, an income statement module has line items on rows and time on columns. The Net Profit line item shows the net profit for a business.

The formula in the Month-on-month profit change line item uses the PREVIOUS function to retrieve the value of Net Profit from the previous period. The Net Profit for the previous period is subtracted from the Net Profit for the current period to calculate the change in profit from one month to another. As the module's time range starts in 2021, the value for Month-on-month profit change in Jan 21 is the same as the Net Profit.


1234
Lead count1,000600300150

Previous stage lead count

PREVIOUS(Lead count, Sales stage order)

01,000600300

Change

Lead count - PREVIOUS(Lead count, Sales stage order)

1,000-400-300-150

In this example, the function is dimensioned over the Sales stage order list, which is on columns.

The formula in the Previous stage lead count line item retrieves the lead count from the item immediately before the current one in the Sales stage order list. The formula in the Change line item calculates the difference in lead count between the current stage and the previous one. It shows how many leads were lost or gained as you move from one stage to the next in the pipeline.