The NEXT function evaluates an expression based on the next period in the Time dimension.
For example, you can use this function to compare the performance of the current period against the forecast value for the next period.
|Number, Boolean, date, time period, list, or text
|The expression to return the value from the next period for.
The NEXT function returns a result of the same data type as the Expression argument (unless the expression resolves to a different data type).
This formula returns the value from the next period for each value of the Revenue line item.
If the NEXT 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, NEXT returns a value of 0.
- Boolean, NEXT returns a value of FALSE.
- text, date, or time period, NEXT returns a value of BLANK.
The result line item you use the NEXT function in must have Time as a dimension.
In Polaris, you cannot use NEXT in formulas of line items with a formula summary method. In the Classic Engine, you can.
For time outside the time range hierarchy, Polaris returns zero or blank values. In the Classic Engine, NEXT can apply to a time outside the time range hierarchy.
In the Classic Engine:
- You can use the NEXT function only with a time dimension. In Polaris, you can use NEXT with any dimension except Versions. For Versions, use NEXTVERSION.
- 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.
Forecast Profit Change
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.
In this model, the Actual version changes to Forecast in Apr 21, as Switchover is enabled in Model Settings > Versions. The Forecast value for Apr 21 uses a formula to calculate a forecast based on an average of the values for the past three months. As the current period changes, this formula calculates a forecast profit for the next period.
The formula in the Forecast Profit Change line item uses the NEXT function to retrieve the value of Net Profit from the next period. The Net Profit for the current period is subtracted from the Net Profit for the next period to calculate the change in profit from one month to another. This includes the Forecast value for Apr 21, which can be used to plan ahead. As there's no value for May 21 yet, the final value of the Forecast Profit Change line item is the value of the Net Profit line item for Apr 21.