Using variables and parameters

You can use variables and parameters to help make rules as generic as possible, and therefore minimize the number of times that you have to create a new rule.

  • A variable represents a model property. Variable values can be set by a Modeler in the Model Properties workspace, or by the action of a Model Variable rule.

  • A parameter represents a value that is local to a particular business rule. A parameter is created and used in a business rule by a Modeler, but parameter values are inserted during runtime by a user.

Parameter and variable types

Parameters and variables may represent any one of the following Planning Server types:

  • Member of a dimension

  • Members of a dimension

  • Whole number value

  • Decimal number value

  • String value

  • Boolean (True/False) value

Creating and using a parameter

With PerformancePoint Expression Language (PEL), you can parameterize a business rule. A parameterized business rule lets you create generic statements that can be customized at runtime.

You can use options from the Planning Business Modeler Business Rules workspace to add a parameter to a rule. For more information, see Adding a rule parameter. To use a parameter in a rule, add the parameter, and then reference the parameter in the rule. When you reference a parameter in the rule text, enclose the parameter label in dollar signs ($), such as $MyParameter$.

The following example shows how to use parameters for the Entity and the Currency dimensions.

SCOPE(
       [Scenario][All Members].[Forecast],
       [Account].[Corporate].[Salary],
       $MyEntity$.LeafMembers,
       $MyCurrency$.LeafMembers,
       [BusinessProcess].[Standard].[INPUT],
       [HR].[HR].[Internal].LeafMembers
       );

When the rule runs, Planning Business Modeler displays the Parameters for Rule dialog box. In this dialog box, users can enter values for each parameter in the rule.

Setting default values for parameters

A Modeler can set a default value for a parameter in the Business Rule workspace. If a parameter has a default value, the default value appears when the parameter is displayed in the Parameters for Rule dialog box. A user can accept the default value, or enter a custom value.

Note

Default values are especially useful for Automatic rule sets, because when Planning Business Modeler runs the rule automatically, it will use the default values for the rule parameters.

The CurrentPeriod system parameter

Planning Business Modeler includes the CURRENTPERIOD system parameter that returns the current period in the Time dimension for the model that is being used.

You do not have to create the CURRENTPERIOD parameter.

To find the current period for a model, examine the Model Summary page, under the General section.

The following example shows a business rule that uses the CURRENTPERIOD parameter to specify the Time dimension member. Notice that the parameter is enclosed in dollar ($) signs, $CURRENTPERIOD$.

SCOPE (
   [Account].[Corporate].[Marketing].LeafMembers,
     [BusinessProcess].[Standard].[INPUT],
     [Currency].[All Members].[USD],
     [Entity].[ResortOps].[Resort - Tahoe],
     [ParentEntity].[All Members].[NONE],
     [Scenario].[All Members].[Forecast],
     $CURRENTPERIOD$,
     [Version].[All Members].[NONE],
     [BusinessDriver].[All Members].[NONE],
     [Product].[ResortProducts].[Ski Tuning] );
   THIS = ([Scenario].[All Members].[Budget]) * 1.5;
END SCOPE;

Creating and using a model variable

A variable, or model variable, represents one of the properties of a model. Typically, a variable might be used to specify a configuration setting, such as Allow Annotations, or an important value, such as Reconciliation Balancing Account.

You can use options from the Model Properties workspace in Planning Business Modeler to add a model variable to a model, or to manage an existing variable. For more information, see Add, edit, or delete a model property.

To use a model variable in a business rule, add the variable, and then reference the model variable in a rule. When you reference a variable in rule text, enclose the variable label in ampersand signs, (&), such as &MyVariable&.

The following example shows how to use three model variables (&CONVERSION INCOME&, &FXO&, and &FXF&) to represent conversion income values and values for Flow dimension members.

SCOPE [Account].TypeFilterInclude("BS-Net income");
   SCOPE [Flow].TypeFilterInclude("PY Adj", "Opening", "Appropriation");
         ()                          += PRIORAVE * CURRENTTUPLE; 
         (&CONVERSION INCOME&,&FXO&) += OPE * CURRENTTUPLE; 
         (&CONVERSION INCOME&,&FXO&) -= PRIORAVE * CURRENTTUPLE; 
   END SCOPE;
   SCOPE [Flow].TypeFilterExclude("PY Adj", "Opening", "Appropriation");
         ()                          += AVE * CURRENTTUPLE; 
         (&CONVERSION INCOME&,&FXF&) += CLO * CURRENTTUPLE; 
         (&CONVERSION INCOME&,&FXF&) -= AVE * CURRENTTUPLE; 
   END SCOPE;
END SCOPE;

Using a model variable rule

You can create a business rule of type model variable. A model variable rule changes the value of one or more model properties. When a model variable rule is executed, Planning Business Modeler sets the value of the variable to the value specified in the rule.

The following example shows how a model variable rule can be used to set the value of a model property called GrowthRate.

&GrowthRate& = 0.10;

See Also

Concepts

Parameters (PEL)
Variables (PEL)