1. Calculation functions
  2. All functions
  3. Time and date functions
  4. PREVIOUS

The PREVIOUS function evaluates an expression based on the previous period of the Time dimension.

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

Syntax

PREVIOUS(Expression)

Arguments

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

The PREVIOUS function returns a result of the same data type as the Expression argument (unless the expression resolves to a different data type).

Syntax Example

PREVIOUS(Revenue)

This formula returns the value from the previous period for each value of the Revenue line item.

Additional information

Values outside of the line item time range

If the PREVIOUS function returns a value from outside of 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.

Brought-Forward values

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.

Constraints

  • If the Expression argument has a data type of list or time period, and does not resolve to a different data type, the result line item must have the same data type.
  • The result line item you use the PREVIOUS function in must have Time as a dimension.

Related Anaplan functions

Examples

Month on month profit change


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.

Disclaimer

We may update our documentation occasionally, but will only do so in a way that does not negatively affect the features and functionality of the Anaplan service.