Introduction
In this article, we'll explain to use an Application Variable together with a Filter Variable to display "Last Year Actual" in a Form, as shown below.
Note: If you're unfamiliar with Application Variables and Filter Variables, please refer to the linked articles before we begin.
Example
In the Form, notice that the column headers are controlled by a FiscalYear Filter. As you should already know how to set these headers, we'll focus primarily on how to set up just the Previous Year header, i.e., the highlighted column above. Its value is defined by taking the selection of the FiscalYear Filter back by one year.
1. Go to Standard Variables and click Add.
2. Name the variable Previous Year and click Save.
3. Click Edit and define the variable as follows:
${[Time].[FiscalYear]}.lag(1)
${[Time].[FiscalYear]} refers to the Filter Variable value of FiscalYear. The definition is driven by the context used with the variable.
4. Go to the Layout tab of your target Form as shown below. Use FiscalYear as a Filter Variable here.
5. Go to the Column tab to define the axis. Use Variable to add the Application Variables and Filter Variables to the column.
Tip: Check out this article on how to configure rolling forecasts for more information about the Prior Months and Forward Months variables used here.
Once all that is set, your Form should behave as shown below. Notice that changing the FiscalYear Filter moves everything forward a year, while the first column continues to lag behind.