Substitution Variables
  • 11 Minutes to read
  • Dark
    Light
  • PDF

Substitution Variables

  • Dark
    Light
  • PDF

Article summary

What are Substitution Variables

Substitution variables are used in the creation of Dynamic Reports and Report Sets. A substitution variable replaces a complex multi-dimensional expression (Rule) with a specified value. Substitution variables must be added to Report Sets as lines to be reflected in reports. Planful provides over 40 system-defined substitution variables.

The purpose of using a substitution variable is to:

  • Improve report performance

  • Improve Report Set maintainability

  • Dynamically display report column/row headers

How to Access the Substitution Variable Page

To access the Substitution Variable page, navigate to Maintenance > Reports > Cube Settings and click the Substitution Variables tab.

How to Add a Substitution Variable to Use in a Reporting Formula

  1. Navigate to Maintenance > Reports > Cube Settings and click the Substitution Variables tab.
  1. Click the Add icon.
  1. Enter an identifier in the Code field.
  1. Select the reporting area where you want the substitution variable defined.
  1. Select the dimension where you want the substitution variable defined.
  1. Select the Substitution Value by opening the Hierarchy dialog page. Use the hierarchy or filter functions to search for, and select, a specific value.
  1. Click Save.

What are Derived Variables

Derived Variables contain a formula that references a Substitution Variable and derives an appropriate value by evaluating the formula.

In Practice

In the example below @CURYR@ is the substitution variable, which displays the current year for the Workforce reporting area. Derivatives of @CURYR@ are:

@CURYR+1@ = pulls data for the year following the current year

@CURYR+2@ = pulls data for 2 years from the current year

Description of Fields on the Substitution Variable Page

Grid Fields

Code - The name of the substitution variable as used in reporting formulas.

Reporting Area - The reporting area where the substitution variable is defined.

Dimension - The dimension where the substitution variable is defined.

Value - The value a substitution variable points to.

Derived Variables - The number of derivatives for the selected variable.

Substitution Variables Explained with Examples

A substitution variable contains a Name and Value pair. For example:

Substitution Variable Name: @CURMNTH@

Substitution Variable Value: Jan-2018

The Substitution Variable Name is replaced by its Value when the report is executed, thereby making reporting flexible. In the example above, you may create a report column using a the @CURMNTH@ Substitution Variable. When the report is executed the Name is substituted by its Value (i.e. Jan-2018).

In Practice

Let's say you want to create a Rule for the following:

Prior Year Quarter 1

Prior Year Quarter 2

Prior Year Quarter 3

Prior Year Quarter 4

Q1 Prior year – Openingperiod(Ancestor(Parallelperiod(year,1,Time.CurrentMember),year))

Q2 Prior year - Openingperiod(Quarter,Ancestor(Parallelperiod(year,1,Time.CurrentMember),year)).lead(1)

Q3 Prior year - Openingperiod(Quarter,Ancestor(Parallelperiod(year,1,Time.CurrentMember),year)).lead(2)

Q4 Prior year - Openingperiod(Quarter,Ancestor(Parallelperiod(year,1,Time.CurrentMember),year)).lead(3)

You can also create prior year quarters as derived variables on the @CURQTR@ substitution variable:

@PRYRQTR1@ - Openingperiod(Quarter,Ancestor(Parallelperiod(year,1,@CURQTR@),year))

@PRYRQTR2@- Openingperiod(Quarter,Ancestor(Parallelperiod(year,1,@CURQTR@),year)).lead(1)

@PRYRQTR3@- Openingperiod(Quarter,Ancestor(Parallelperiod(year,1,@CURQTR@),year)).lead(2)

@PRYRQTR4@- Openingperiod(Quarter,Ancestor(Parallelperiod(year,1,@CURQTR@),year)).lead(3)

Substitution Variables can be used on any of the dimensions or attributes available and in any of the reporting areas. You cannot create a substitution variable that includes multiple dimensions, however, you can add multiple dimensions while defining static report sets. For example, if you want to define November MTD you can set the Rule to (@CURMTH@,[Measures].[MTD]) in your report set. If you want to set November for a selected department you might use the following (@CURMTH@,@CURDEPT@).

Attributes and attribute hierarchies mapped on the Attribute Settings page are available in the Financial and Scorecard Reporting Area. Attributes mapped to properties are not available.

Types of Substitution Variables

  1. Standard Substitution Variables:Standard Substitution Variables point to a value, which can be updated by a Reporting Administrator using the Substitution Variable page located under the Maintenance menu. Substitution Variables can be established for any of the dimensions or attributes available in any of the reporting areas.

    For example, variable @CURYR@ contains the year value 2018, which internally points to the appropriate Time dimension member such as [Time].&[5045]. The value is used on column headers and the dimension member is used in MDX expressions.

  1. Derived Variables:Derived Variables contain a formula which references a Substitution Variable and derives an appropriate value by evaluating the formula.

    For example, A Derived Variable named ‘@CURMTH -1@’ can:

    Reference the following Substitution Variable: @CURMTH@.

    Contains a formula, such as: @CURMTH.Lag(1).

    Will result in the month preceding the Current Month based on setup.

    At run time @CURMTH.Lag(1) is evaluated based on the value of @CURMTH@.

    Generally, the value is used for column headers and the dimension member is used in MDX expressions.

How to Set Up Substitution Variables

  1. Navigate to Maintenance > Reports > Cube Settings and click the Substitution Variables tab.
  1. Review the list of substitution variables delivered with the application.
  1. Click the Add button to setup a new substitution variable on the Add Substitution Variable page.
  1. Complete the fields on the Add Substitution Variable page. Note that substitution variables are defined for a reporting area and dimension.
  1. Select the newly added substitution variable on the list page and click the Derived Variables button to view the corresponding derived variables.
  1. Add new derived variables by clicking the Add button on the Derived Variables list page.
  1. The Add Derived Variable page is opened. Complete the fields on this page.
  1. Click Save.

How to Use Substitution Variables

Substitution variables are used in the creation of Dynamic Reports. A substitution variable replaces a complex multi-dimensional expression (Rule) with a specified value. Substitution variables must be added to Report Sets as lines to be reflected in reports. Planful provides over 40 system-defined substitution variables.

Here is a list of places where you can use substitution variables:

As an Efficient Way to Replace Formula Exceptions

Example: To display the current period in the column header of a report, replace the column set’s line name with a substitution variable, such as @CURMTH@. When the report is run, @CURMTH@ will be replaced with the actual month name Mar-10.

In Combination with Static Text

Examples:

YTD~ @CURMTH@ will display YTD~ Jan-18

@CURYR@Actual will display 2018 Actual

To Improve Report Performance by Avoiding the Use of Calculated or Measured Dimensions when Building Column Sets

The following Report Set is commonly used:

YTDMTD
ActualBudgetVarianceActualBudgetVariance

Setting up this Report Set requires the usage of complex Rules that typically require a column set on a Calculated or Measured dimension and utilizes the Reporting scenario for the Budget column. The following table displays commonly used formulas to deliver report columns.

Line Name

Formula Without Substitution Variables

YTD~Actual

([Measures].[YTD],[Scenario].&[1],[Calculated].&[1])

YTD~Budget

([Measures].[YTD],StrToMember ("Scenario.&["+Time.Currentmember.properties("Budget_Id")+"]")),[Calculated].&[1])

YTD~Variance

Custom Formula

MTD~Actual

([Measures].[MTD],[Scenario].&[1] ,[Calculated].&[1])

MTD~Budget

([Measures].[MTD],StrToMember ("Scenario.&["+Time.Currentmember.properties("Budget_Id")+"]")),[Calculated].&[1])

MTD~Variance

Custom Formula

While the rules above deliver the expected result, they are complex. This complexity adversely impacts report performance. The same report can be set up more efficiently using Substitution Variables. The table below displays how Substitution Variables compare to the formulas in the table above.

Line Name

Formula with Substitution Variables

YTD~Actual

([Scenario].&[1] ,[Measures].[YTD])

YTD~Budget

(@CURBGT@,[Measures].[YTD])

YTD~Variance

Custom Formula

MTD~Actual

([Scenario].&[1],[Measures].[MTD])

MTD~Budget

(@CURBGT@,[Measures].[MTD])

MTD~Variance

Custom Formula

Performance for the Report Set depicted in the table above can be improved by moving the repeated member on the Page axis. The Report Set above uses [Measures].[MTD] and [Measures].[YTD] frequently. Move one of these members to the page level. For example, use the member [Measures].[YTD] on the Page axis rather than repeating [Measures].[YTD] on the first and second lines as shown in the table below.

Line Name

Formula with Substitution Variables

YTD~Actual

[Scenario].&[1]

YTD~Budget

@CURBGT@

YTD~Variance

Custom Formula

MTD~Actual

([Scenario].&[1],[Measures].[MTD])

MTD~Budget

(@CURBGT@,[Measures].[MTD])

MTD~Variance

Custom Formula

To improve report performance instead of reporting scenario functionality

When using reporting scenario functionality to retrieve the budget and forecast for a selected year, you might use the following rule.

StrToMember ("Scenario.&["+Time.Currentmember.properties("Budget_Id")+"]"))

While the rule above delivers the expected result, it slows report performance. A performance improvement is to use Substitution Variables as described below.

Line Name

Previous Approach to Formula

Formula with Substitution Variables

Line Name

Previous Approach to Formula

Formula with Substitution Variables

Current Budget

StrToMember ("Scenario.&["+Time.Currentmember.properties("Budget_Id")+"]"))

@CURBGT@

Current Forecast

StrToMember ("Scenario.&["+Time.Currentmember.properties("forecast_Id")+"]"))

@CURFCST@

Current Month Budget

(Time.Currentmember,StrToMember ("Scenario.&["+Time.Currentmember.properties("Budget_Id")+"]")),[CalculatedDim].&[1])

(@CURMTH,@CURBGT)

Prior Year YTD

(Parallelperiod(Year,1,Time.currentmember),[Measures].[YTD])

(@PREVYEAR@,[Measures].[YTD])

To improve efficiency in building report sets

Substitution Variables aide in the setup and maintenance of time-based Report Sets, such as Trailing 12 months, along with Budget and Forecast columns. The following example displays a Trailing 12-month Report Set:

Line Name

Previous Approach to Rule

Rule with Substitution Variables

Line Name

Previous Approach to Rule

Rule with Substitution Variables

Current Month

(Time.Currentmember,[CalculatedDim].&[1])

@CURMTH@

Current Month - 1

(Time.Currentmember.Lag(1),[CalculatedDim].&[1])

@CURMTH-1@

Current Month - 2

(Time.Currentmember.Lag(2),[CalculatedDim].&[1])

@CURMTH-2@

Current Month - 3

(Time.Currentmember.Lag(3),[CalculatedDim].&[1])

@CURMTH-3@

Current Month - 4

(Time.Currentmember.Lag(4),[CalculatedDim].&[1])

@CURMTH-4@

Current Month - 5

(Time.Currentmember.Lag(5),[CalculatedDim].&[1])

@CURMTH-5@

Current Month - 6

(Time.Currentmember.Lag(6),[CalculatedDim].&[1])

@CURMTH-6@

Current Month - 7

(Time.Currentmember.Lag(7),[CalculatedDim].&[1])

@CURMTH-7@

Current Month - 8

(Time.Currentmember.Lag(8),[CalculatedDim].&[1])

@CURMTH-8@

Current Month - 9

(Time.Currentmember.Lag(9),[CalculatedDim].&[1])

@CURMTH-9@

Current Month - 10

(Time.Currentmember.Lag(10),[CalculatedDim].&[1])

@CURMTH-10@

Current Month - 11

(Time.Currentmember.Lag(11),[CalculatedDim].&[1])

@CURMTH-11@

Current Month - 12

(Time.Currentmember.Lag(12),[CalculatedDim].&[1])

@CURMTH-12@

Current Budget

(Ancestor(Time.Currentmember,1,Year), StrToMember ("Scenario.&["+Time.Currentmember.properties("Budget_Id")+"]")),[CalculatedDim].&[1])

(@CURYR@,@CURBGT)

Current Forecast

(Ancestor(Time.Currentmember,1,Year), StrToMember ("Scenario.&["+Time.Currentmember.properties("forecast_Id")+"]")),[CalculatedDim].&[1])

(@CURYR@,@CURFCST)

To overcome Rule Limitations

You cannot use the same dimension on two axes simultaneously. For example, a report that requires a Report Set on the Time dimension, will not allow selection of Time dimension members at the Page level. To set up a trailing 12-month report, define the column set on either the Calculated or Measure dimension. Time should be on the Page axis. This setup does not use substitution variables so performance will not be optimal. With Substitution Variables, the report column set can be set up on the Time dimension directly and the required selections can be made using Substitution Variables, which will result in improved performance.

How to Transition Existing Reports to Use Substitution Variables

Transition an existing report to utilize Substitution Variables to take advantage of the following benefits:

  • Improve Financial report performance.

  • Improve the ease and maintenance of Report Sets.

  • Display the report column/row headers dynamically.

  • Provide you with additional flexibility in changing report parameters.

Substitution Variables and their derivatives may be found by navigating to Maintenance > Reports > Cube Settings, Substitution Variables. This list displays system-defined variables, as well as any custom variables you create.

Complete the following steps to transition your existing reports to Substitution Variables:

  1. Review the report and corresponding row and column set(s) in order to determine how you want to proceed. For example, if the column set is built on the measures dimension or calculated dimensions, consider how the report may be modified to use time or scenario on the column. Also consider using Substitution Variables in column headers and row titles.
  1. Make a copy of the existing report prior to beginning the transition. This copy will be modified during the transition, but you can compare the end result with the original report/report set(s) to validate data.
  1. If you plan to change the dimension upon which the report set is built, you must create a new report set as it is not possible to change an existing report set to run on a different dimension. If you plan to use the same dimension for your new report set, you may copy the original report set. This copy will be modified during the transition and you can then compare the end result with the original report/report sets to validate data.
  1. Modify the formulas on the Advanced Rule page from the current string to include the appropriate Substitution Variables. For example; In a rolling twelve month column set, you can remove the expression “Time.CurrentMember.lag(1)” and replace it with “@CURMTH-1@” for the column pulling the last month’s data.
  1. Modify the column headers/row titles as necessary. A column previously titled using Formula Exceptions to display the appropriate month or hardcoded to fixed text can be replaced with a Substitution Variable in the column header within the column set. This header may include the Substitution Variable alone, or included with static text. For example; If the month is May, the column header within the column set may be “@CURMTH-2@” to display “March.” Or, it may be “YTD @CURMTH-2@” to display “YTD March.”
  1. Save the copied and modified report set. Adjust the dimensions on the copied report if you created new report sets to accommodate the Substitution Variables. When you have the report highlighted within the Reports file cabinet, select “Setup” to view the Report Details and Report Settings. For example, you may need to move one dimension to the Page (such as Measures) and another to the Column (such as time) to use the new column set.
  1. Run the newly transitioned report. Compare the results to the original report/report set(s) and make adjustments if necessary. You may change the values of the Substitution Variables at run time, however, these changes will not be saved with the report.
  1. In addition, moving highly repeated members of Rules to the page level will improve report performance. If “*Measures+.*MTD+” is used in many of the Rule within a report set, you may move Measures to the page and include the measures dimension in the Rule only in fields where you do not want MTD.
  1. Delete or rename the original report, which is no longer in use. Rename the transitioned report accordingly.

Use of Substitution Variables in Dynamic Reports

Substitution variables displayed are filtered based on Reporting Area. For example, @CURBDGT@ may be defined under the Financial Reporting Area and therefore can only be used if you select Financial as the Reporting Area while creating a Dynamic Report.

System-Defined Substitution Variables

The following Substitution Variables are available in your application by default.


Variable Name

Variable Type

Purpose

1

@CURMTH@

Substitution Variable

Current Month

2

@CURMTH+1@

Derived Variable

Next Month

3

@CURMTH+2@

Derived Variable

2 Months after Current Month

4

@CURMTH+3@

Derived Variable

3 Months after Current Month

5

@CURMTH+4@

Derived Variable

4 Months after Current Month

6

@CURMTH+5@

Derived Variable

5 Months after Current Month

7

@CURMTH+6@

Derived Variable

6 Months after Current Month

8

@CURMTH+7@

Derived Variable

7 Months after Current Month

9

@CURMTH+8@

Derived Variable

8 Months after Current Month

10

@CURMTH+9@

Derived Variable

9 Months after Current Month

11

@CURMTH+10@

Derived Variable

10 Months after Current Month

12

@CURMTH+11@

Derived Variable

11 Months after Current Month

13

@CURMTH+12@

Derived Variable

12 Months after Current Month

14

@CURMTH-1@

Derived Variable

Previous Month

15

@CURMTH-2@

Derived Variable

2 Months prior to Current Month

16

@CURMTH-3@

Derived Variable

3 Months prior to Current Month

17

@CURMTH-4@

Derived Variable

4 Months prior to Current Month

18

@CURMTH-5@

Derived Variable

5 Months prior to Current Month

19

@CURMTH-6@

Derived Variable

6 Months prior to Current Month

20

@CURMTH-7@

Derived Variable

7 Months prior to Current Month

21

@CURMTH-8@

Derived Variable

8 Months prior to Current Month

22

@CURMTH-9@

Derived Variable

9 Months prior to Current Month

23

@CURMTH-10@

Derived Variable

10 Months prior to Current Month

24

@CURMTH-11@

Derived Variable

11 Months prior to Current Month

25

@CURMTH-12@

Derived Variable

12 Months prior to Current Month

26

@CURBDGT@

Substitution Variable

Current Budget

27

@CURFCST@

Substitution Variable

Current Forecast

28

@CURQTR@

Substitution Variable

Current Quarter

29

@CURQTR+1@

Derived Variable

Next Quarter

30

@CURQTR+2@

Derived Variable

2 Quarters after Current Quarter

31

@CURQTR+3@

Derived Variable

3 Quarters after Current Quarter

32

@CURQTR+4@

Derived Variable

4 Quarters after Current Quarter

33

@CURQTR-1@

Derived Variable

Prior Quarter

34

@CURQTR-2@

Derived Variable

2 Quarters prior to Current Month

35

@CURQTR-3@

Derived Variable

3 Quarters prior to Current Month

36

@CURQTR-4@

Derived Variable

4 Quarters prior to Current Month

37

@CURYR@

Substitution Variable

Current Year

38

@CURYR+1@

Derived Variable

Next Year

39

@CURYR+2@

Derived Variable

2 years after Current Year

40

@CURYR-1@

Derived Variable

Previous Year

41

@CURYR-2@

Derived Variable

2 Years prior to Current Year


Was this article helpful?