NEXT Macro

The NEXT macro is used to select the attribute value for the date dimension that immediately follows the current value.

In the following example, NEXT refers to the opportunity probability in the subsequent month.

SELECT Opp_Probability WHERE Month= NEXT

In the following example, the PREVIOUS and NEXT macros are used to specify an inclusive range of weeks between last week and next week:

SELECT Payment WHERE Week BETWEEN PREVIOUS AND NEXT

Below, the PREVIOUS and NEXT macros are used to specify the specific set of attribute values to use. In this case, the set of payments to select may come from last year or the next year – not the current year:

SELECT Payment WHERE Year IN (PREVIOUS,NEXT)

NEXT is identical to THIS + 1. To reference the next time period, use the NEXT macro.

Powered by Atlassian Confluence and Scroll Viewport.