Analysis Cycle parameter variable substitution
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 option on the main worksheet toolbar, the current module data context is used.
- If the macro is executed using a 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 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 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 option in the main worksheet toolbar, the current/prevailing module data context is used.
- If the macro executed using a 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 option on the main worksheet toolbar, the current module data context is used.
- If the macro executed from a 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 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.
- 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.