Parameter Variable substitution

The parameter variables are used in commands to represent the specific context or elements that are replaced at run-time by a value specific to the current context and settings. The parameter variables are validated at run-time therefore all the variables are allowed when creating macros, interface services and calculation rules or worksheet parameters. For calculation rules, variables are substituted before creating these rules (for the cycle period) in Infor BI OLAP on initial creation or when resuming a rule using the Refresh option.
Note: 
  • Variables are not case sensitive
  • Only one variable can be allowed per parameter when used for the macro functionality
  • The format used for application variables is app_var_VarName
  • Application variables are declared at a system level and can be overridden at a cycle level
  • Application variables are run time variables and can be replaced by the version of the current cycle.

For the parameter details, see Parameter variable.

The context parameters (%itemcontext%, %locationcontext%, %periodcontext%) have these properties when mapped in macro commands:

  • The variables pick up the current context values when you execute a macro from a worksheet.
    Note: 
    • If the macro is executed using the Execute Macro option on the main worksheet toolbar, the current module data context is used.
    • If the macro is executed using a Macro option on the current worksheet, the current worksheet’s data context for that dimension is used.
  • When you execute a macro not from the worksheets, for example from the Cycle period details or Scenario details page, no value can be substituted, and the macro fails.

The context parameter (%measurecontext%) has these properties when mapped in macro commands:

  • The variable picks up the current context values when you execute a macro from a worksheet.
    Note: 
    • If the macro is executed using Execute Macro option in the main worksheet toolbar or if no measure context has been passed to a worksheet, no value can be substituted, and the macro fails.
    • If the macro is executed using a Macro option in the destination panel of a multi-panel worksheet, the current worksheet’s measure context is used.
  • When you run a macro not from the worksheets, for example from the Cycle Period details or Scenario details page, no value can be substituted, and the macro fails.

When the context parameters (%cyclecontext%, %cycleperiodcontext%, %scenariocontext% and %modelcontext%) are cast from the macro context:

  • A CyclePeriod macro has cyclecontext and cycleperiodcontext.
  • A cycle period macro containing the command RunScenarioMacro can utilize the scenariocontext when executed from a worksheet.
    Note: 
    • If the macro is executed using Execute Macro option in the main worksheet toolbar, the current/prevailing module data context is used.
    • If the macro executed using a Macro option in the current worksheet, the current/prevailing worksheet’s data context (%scenariocontext%) is used. For example, passed context from a panel link (if applicable) or the module data context.
  • A Scenario macro has cyclecontext, cycleperiodcontext and scenariocontext. Scenariocontext is dependent on the macro initiation process:
    • If a scenario macro is executed from the Cycle Period details or Scenario details page, the current scenario context is used.
    • If the macro executed from the Execute Macro option on the main worksheet toolbar, the current module data context is used.
    • If the macro executed from a Macro option on the current worksheet, the current worksheet's context (%scenariocontext%) is used.
  • A system macro containing the command RunCyclePeriodMacro can utilize cyclecontext, cycleperiodcontext, when executed from a worksheet.
  • A system macro containing the command RunScenarioMacro can utilize cyclecontext, cycleperiodcontext and scenariocontext when executed from a worksheet.
    • If the macro is executed from the Macro option in the current worksheet, the current worksheet's context (%scenariocontext%) is used. For example, passed context from a panel link, (if applicable) or the module data context.
  • A system macro containing the RunASMacro command can utilze modelcontext when executed from advanced Scheduling Model details.
  • Other system macro commands do not contain a context. Therefore, no value can be substituted, and the macro fails.

For %previouscycleperiod-Startdate% and %previouscycleperiod-Enddate% parameters, if there is no previous cycle period, %horizon-start% (the first available period) is used.

The parameters that are invalid for the function that is being run, result in the termination of the program and an error message is displayed.