CalculatePeriodWeigting macro
- Measure Code
- The measure code that is populate with the calculated period measure values.
The value for the Command field must be specified in this format:
CalculatePeriodWeighting(Measure Code)
On execution, the period weighting measure is populated by calculating the ratio of the number of days in each bucket over the horizon (history and future) for the calendar used within the cycle. The values are stored at ICONST and LCONST level for all base periods. The values are calculated as:
- Number base Periods = Total Number of base periods Cycle History Horizon + Cycle Future Horizon
- Number of days = Total Number of days over the horizon
- Period Factor = Number of days / Number of base periods
- Period Weighting for each bucket = Number of days in bucket / Period Factor
This table lists the examples of the CalculatePeriodWeighting macro:
Requirement | Syntax |
---|---|
Populate the HWEIGHT measure with period weightings for the ICONST and LCONST item and location elements for all periods of the cycle period horizon | CalculatePeriodWeighting("HWEIGHT") |
Validations are performed when you execute the macro. If any of the validation fails, the macro is aborted, and the related error message is displayed.
This table lists the Scenario Macro commands as compared to the Cycle Period/Scenario status and validation messages.
Cycle Period Status | Scenario Status | Can Execute? | Validation Message |
---|---|---|---|
Pending | N/A | No | Cannot run macro {0} because Cycle Period has status ‘Pending’ |
Running | WIP | Yes | N/A |
Running | Review, Rejected, Stopped, Approved, Published | No | Cannot run macro {0} because Scenario has status {1} |
Paused | Any | No | Cannot run macro {0} because Cycle Period is not ‘running’ |
Completed | Any | No | Cannot run macro {0} because Cycle Period has status ‘Completed’ |
Aborted | Stopped | No | Cannot run macro {0} because Cycle Period has status ‘Aborted’ |
Archived | Any | No | Cannot run macro {0} because Cycle Period has status ‘Archived' |
This table lists the error message displayed during the macro execution:
Validation Condition | Error Message |
---|---|
Ensure the specified measure is valid, editable for the cycle. Module (Internal or Published) and Enabled. | measure "{0}" cannot be found. |
Ensure the measure is not of Type = Date | measure "{0}" cannot be of Type = Date. |
Ensure the measure specified is not of type Market Intelligence. | measure {0} cannot be of type Market Intelligence. |
Where specified, ensure the Optimize flag is valid. The values must be true or false. | invalid parameter value {0}. Must be true or false. |
Ensure the measure specified is not of type Transactional Data. | Measure {0} cannot be of type Transactional Data |
Ensure the measure specified is not of type Orders. | Measure {0} cannot be of type Order. |