Macro commands for a scenario

The commands that can be used in macros, at the scenario level. The parameters specified in brackets are optional.

Command Parameters Description Examples
CalculatePeriodWeighting Measure Code Calculate the period weightings from the cycle period calendar and populate to the selected measure for the ICONST and LCONST dimensions.
CalculatePeriodWeighting ("HWEIGHT") Populate the HWEIGHT measure with the period weightings for the ICONST and LCONST item, and location elements for all periods of the cycle period horizon.
ClearMeasure [Measure Code], [Item Hierarchy Node], [Location Hierarchy Node], [Period label]
  • Null measure code = all.
  • Null item hierarchy node = all. If specified, that node and the children.
  • Null location hierarchy node = all. If specified, that node and the children.
  • Null period label = the horizon for this cycle. If specified, the duration of that calendar period at the level to store plans.
Clear data from a specified measure for an item, location, or period in a scenario or from all measures.
ClearMeasure ("","","","") Clear all measures, for all items, at all locations, for all periods of the cycle period horizon.
ClearMeasure ("FREV","","","") Clear the FREV measure for all items, at all locations, for all periods of the cycle period horizon.
ClearMeasure ("","GOO","","") Clear all measures for GOO items, at all locations, for the cycle period horizon.
ClearMeasure ("","","All DC","") Clear all measures for all items, at all locations, for the cycle period horizon.
ClearMeasure ("","","", "FY 10") Clear all measures for all items, at all locations, for the duration of the calendar period "FY 10" (at the cycle calendar level to store plans).
ClearMeasure ("BREV","GOO","US", "FY 10") Clear the BREV measure for GOO items at US locations, for the duration of the calendar period "FY 10" (at the cycle calendar level to store plans)
CopyCyclePeriodData Source, Cycle, Cycle Period, Source Scenario Name, Source Item Level, Source Location Level, Source Calendar Level, [Measure Code], [Item Hierarchy Node], [Location Hierarchy Node], [Period label], [Destination Measure Code]
  • Null measure code = all published and internal measures, including persisted calculated measures, for this module (Source Scenario).
  • Null item hierarchy node = all. If specified, that node and its children.
  • Null location hierarchy node = all. If specified, that node and its children.
  • Null period label = the horizon for this cycle. If specified, the duration of that calendar period (bucket) at the level to store plans.
  • Null or not defined = Source measure code. The measure in the destination cycle period to which data must be copied.
Copy the measure data between the scenarios in the different cycle periods, for the current module.
  • Attempts are made to copy data to a level, with the same name in the destination, based on the Source Item Level, Source Location Level, and Source Calendar Level.
  • Matching of item, location, period, and measure is based on the name, as the configuration versions may differ.
  • When copying between item, location, and calendar hierarchies, you can only copy data to the same or a higher level in the destination hierarchy. For example, if a cycle period is at the daily level, you can copy data to a cycle period at the weekly or monthly level by aggregating the daily periods to weeks and matching the same between the source and destination at this level. You cannot prorate, because spreading factors are not available in all hierarchy types.
  • If source nodes for items, locations, periods, or measures are not matched in the destination, the nodes are reported in a discard log, as per the interface services.
  • The parameter (Source Calendar Level) must be equal to or higher than the calendar level, to store scenario values in the source cycle.
  • Elements represented by (Source Calendar Level) must be specified at the calendar level, to store scenario values in the destination cycle.
  • The unmatched destinations are not reported because the same are considered as newly added and therefore, the value=0.
CopyCyclePeriodData ("Normal-May11","Demand-Baseline", "SKUs","Locations","Weeks", "","","","") Copy all published and internal measures from Demand-Baseline in cycle period Normal May11 at the hierarchy levels "Locations", "Weeks" to the current scenario for all items, at all locations, for the cycle period horizon.
CopyCyclePeriodData ("Normal-May11","Finance-Baseline", "Groups","Regions","Weeks", "BREV","","") Copy the BREV measure from Finance-Baseline in cycle period Normal May11 at the hierarchy levels "Groups", "Regions", "Weeks" to the current scenario for all items, at all locations, for the cycle period horizon.
CopyCyclePeriodData ("Normal-May11","Finance-Baseline", "Groups","Regions","Weeks", "","GOO","","") Copy all valid measures from Finance-Baseline in cycle period Normal May11 at the hierarchy levels "Groups", "Regions", "Weeks" to the current scenario for GOO items, at all locations for the cycle period horizon.
CopyCyclePeriodData ("Stategic-Q1 11","Demand-Baseline", "SKUs","Locations","Weeks", "","","", "FY 10") Copy all valid measures from Demand-Baseline in cycle period Strategic Q1 11 at the hierarchy levels "SKUs", "Locations", "Weeks" to the current scenario for all items, at all locations for the duration of the calendar period "FY 10" (at the cycle calendar level to store plans).
CopyCyclePeriodData ("Normal-Apr11","Finance-Baseline", "Groups","Regions","Weeks", "BREV","GOO","US", "FY 10") Copy the BREV measure from Finance-Baseline in cycle period Normal Apr11 at the hierarchy levels "Groups", "Regions", "Weeks" to the current scenario for GOO items at US locations for the duration of the calendar period "FY 10" (at the cycle calendar level to store plans).
CopyCyclePeriodData("Normal","Apr11","Finance-Baseline","Groups","Regions","Months","BREV","GOO","US","FY 10","FREV") Copy the BREV measure from the Finance-Baseline, in Normal Apr11 cycle period at the hierarchy levels "Groups", "Regions", "Months" to the FREV measure for the current scenario for GOO items at US locations. This is for all months within the calendar period "FY 10". Monthly values are summed up from weeks (assuming a weekly calendar level to store scenario values for the source cycle period, as in the previous examples).
CopyLastPeriodMeasure [Scenario], [From Measure Code], [To Measure Code], [Period]
  • Null scenario implies a published scenario for this module.
  • Null From measure code implies All.
  • Null To measure code implies From measure code.
  • Null Period implies all periods.
Copy data from the previous running or completed cycle period for a scenario and a specified measure; or all measures for which this module is the system of record. Allows copying of a measure to a different "to measure", where specified. Allows copying of a specified (range of) periods or all.
  • CopyLastPeriodMeasure ("","")
  • CopyLastPeriodMeasure ("","","","")
  • CopyLastPeriodMeasure ("Baseline", "")
  • CopyLastPeriodMeasure ("Baseline", "FREV")
  • CopyLastPeriodMeasure ("Baseline", "FREV","BREV","")
  • CopyLastPeriodMeasure ("Baseline", "FUNITS","HUNITS","FirstPeriod")
CopyScenarioData Source Scenario Name, [Measure Code], [Item Hierarchy Node], [Location Hierarchy Node], [Period label],
  • Null measure code = all published and internal measures for this module.
  • Null item hierarchy node = all. If specified, that node and the children.
  • Null location hierarchy node = all. If specified, that node and the children.
  • Null period label = the horizon for this cycle. If specified, the duration of the calendar period at the level in which to store plans.
Copy measure data between scenarios in the same cycle period and module.
CopyScenarioData ("Demand-Baseline", "","","","") Copy all published and internal measures from Demand-Baseline to the current scenario for all items, at all locations, for the cycle period horizon.
CopyScenarioData ("Finance-Baseline", "BREV","","") Copy the BREV measure from Finance-Baseline to the current scenario for all items, at all locations, for the cycle period horizon.
CopyScenarioData ("Finance-Baseline", "","GOO","","") Copy all published and internal measures from Finance-Baseline to the current scenario for GOO items, at all locations, for the cycle period horizon.
CopyScenarioData ("Supply-Baseline", "","","All DC","") Copy all published and internal measures from Supply-Baseline to the current scenario for all items, at all locations, for the cycle period horizon.
CopyScenarioData ("Demand-Baseline", "","","", "FY 10") Copy all published and internal measures from Demand-Baseline to the current scenario for all items, at all locations, for the duration of the calendar period "FY 10" (at the cycle calendar level to store plans).
CopyScenarioData ("Finance-Baseline", "BREV","GOO","US", "FY 10") Copy the BREV measure from Finance-Baseline to the current scenario for GOO items at US locations for the duration of the calendar period "FY 10" (at the cycle calendar level to store plans).
CallReplenishmentEngine
  • Item Hierarchy Selection: Passed as a node, E.g. "Brand A". The base elements of the selection are used to generate orders. Expects a single element to be passed. Null selection will process all valid items. The selection should adhere to data security rules of the user executing the macro.
  • Location Hierarchy Selection: The location selection passed. Expects a single element [element1] or a set in the form: {[element1],[element2]}. If null then all locations will be considered. The selection should adhere to data security rules of the user executing the macro.
  • Order Start Offset (days): The number of days offset from which to start the generation of orders. The Order Start Offset (days). If no Offset (or zero offset) is specified then the orders are generated from the first day of the current period.
  • Requirements Horizon (days): The number of days from the first day of the current cycle period which can be considered in the requirements planning. If no value is entered then the future horizon (converted to days) is used. (Note that orders are only created from the Order Start Period)
Calls the specified RP engine to generate recommended orders for an item, location selection (or filter) from the current cycle period start date + offset up to a specified horizon.
CallReplenishmentEngine("","","5","60") Calculate orders for all items and locations, considering the first 60 days from the current cycle period, and generating planned orders after the first 5 days (current cycle period start date + 5 days).
CallReplenishmentEngine("%ItemTopNode","%LocationTopNode","","") Calculate orders for all items beneath Item top node (primary hierarchy) at the Location top node (primary hierarchy), starting from the start of the current period and generating orders until the end of the future horizon.
CallReplenishmentEngine("%ItemTopNode","UK","","") Calculate orders for all items beneath Item top node (primary hierarchy) at locations "UK", starting from the start of the current period and generating orders until the end of the future horizon.
EmailWorksheet Export type, Worksheet Name, User / Role, [Item Passed], [Location Passed], [Period Passed] Execute a worksheet with passed context and e-mail the output to a user or list.
  • EmailWorksheet ("PDF","Demand Margin Analysis","Scott")
  • EmailWorksheet ("PDF","Demand Margin Analysis","Scott","","","")
    • Execute Demand Margin Analysis worksheet with default item, location, and period selection from worksheet definition and the e-mail PDF output to the user Scott.
  • EmailWorksheet ("XLS","Demand Essentials","Harry","","","")
    • Execute Demand Essentials worksheet with default item, location, and period selection from the worksheet definition and e-mail XLS output to the user Harry.
  • EmailWorksheet ("PDF","Forecast Accuracy Analysis","Harry","Brand A","","Rolling Weeks")
    • Execute Forecast Accuracy Analysis worksheet with Brand A item node, default location selection, and Rolling Weeks period node and e-mail PDF output to the user Harry.
CallForecastEngine Engine Name, [Algorithm], [Spreading Measure Code], [Item Hierarchy level], [Item Hierarchy selection], [Location Hierarchy level], [Location Hierarchy selection], [Period level], [SMP Measure], [Optimize] Calls the specified forecast engine to generate forecast for an item and location selection. Supports generating forecasts for the item/location selection at the base-level or a grouped forecast for the selection (TFG in DP terms).
  • CallForecastEngine("New Engine","","","","","","","","","")
    • Calls the "New Engine" bypassing all engine setting defaults and calculations for all items and locations. Results are spread using the default spreading measure, if defined.
  • CallForecastEngine("BATS engine","","","SKU","Brand A","Customer","US","Months")
    • Calls the "BATS engine" for valid SKU-level items under the Brand A node in the item hierarchy, for Customer-level locations under the US node in the location hierarchy, at a calendar level of Months. Spreading is not required, as the specified levels and the levels for storing scenario values are equal.
  • CallForecastEngine("BATS engine","","TUPLE_EXISTS","Brand","Brand A","Region","US","Months")
    • Calls the "BATS engine" for the aggregated node Brand A in the item hierarchy, for the aggregated Region node US in the location hierarchy, at a calendar level of Months. Use the measure TUPLE_EXISTS to spread the resultant forecast output to the Cycle.level to store scenario values (if not equal to the specified item, location and period levels).
  • CallForecastEngine("HW Engine","BEST","TUPLE_EXISTS","Product Groups","","Regions","","Months","SMPs","TRUE")
    • Calls the "HW Engine" using the Best (ModelPick) algorithm, spreading results using the TUPLE_EXISTS measure, calculating all Product Groups and all Regions at monthly calendar level. SMPs are calculated by the measure SMPs <> 0 and call the CROSTONS algorithm. Parameter optimization is performed prior to the selection of algorithm and the forecast generation.
RunCommand Data Source, Command text Run a command against a data source. Alias of RunSQL, but extended to support AP and ITK commands when connected to corresponding data source of this type.
  • RunCommand ("AP Production","workflow: Solve")
  • RunCommand ("ITK Data Source","Transfer_Dynamic_Data_Inbox_To_Core")
RunInterfaceService Interface Service Name, Direction, [Reject all on error], [Item Hierarchy Node], [Location Hierarchy Node], Calendar Type, [Calendar parameters]
  • Direction = "Import" or "Export"
  • Reject all on error = "true" or "false". Null = false (import only).
  • Null item hierarchy node = all (export only)
  • Null location hierarchy node = all (export only)
  • Calendar Type = "Bucket" or "Current Bucket" (export only)
  • "Bucket" Calendar parameters = [period label], [num periods]. "Current Bucket" = [num periods]
  • Null [period label] = Current cycle period (= "Current Bucket")
  • Null [num periods] = all periods to calendar end
  • 0 [num periods] = range of selected bucket
  • >=1 [num periods] = export this number of periods at the cycle calendar level to store plans
  • Calendar Type="" (null), Start Bucket is used (the bucket from the first period (oldest) in the cycle period horizon). This can also be used to retrieve all buckets.
Run an interface service for the current scenario that imports or exports the data.
  • RunInterfaceService ("Import My Forecast","Import")
  • RunInterfaceService ("Import My Forecast","Import","True")
  • RunInterfaceService ("Export Scenario file","Export","","","Current Bucket","")
    • All items at all locations from the current cycle period for the cycle period horizon.
  • RunInterfaceService ("Export Scenario file","Export","GOO","","Bucket", "FY 10","0")
    • GOO items at all locations for calendar bucket "FY10".
  • RunInterfaceService ("Export Scenario file","Export","GOO","","Current Bucket","0")
    • GOO items at all locations for the current cycle period bucket, for example, "FY10 M03" for 1 monthly period (if cycle calendar level = months).
  • RunInterfaceService ("Export Scenario file","Export","","US","Current Bucket","52")
    • All items at US locations from the current cycle period for 52 weekly periods (if cycle calendar level = weeks).
  • RunInterfaceService ("Export Scenario file","Export","","","Bucket", "FY10 M03","9")
    • All items at all locations from calendar bucket "FY10 M03" for 9 monthly periods (if cycle calendar level = months).
  • RunInterfaceService ("Export Scenario file","Export","","","", "FY10 M03","9")
    • A null value for the bucket or calender bucket allows you to export all the data, for all the items, and all the locations, in the cycle period horizon.
      Note: When the direction is Export, the value of the Calendar Type parameter can be Null.
RunMapping Source Module, Mapping Name, [Measure Code], [From Scenario Item Hierarchy Node]
  • Null mapping implies default or Direct mapping (where no default).
  • Null measure implies All.
  • Null From Scenario Item Hierarchy Node implies All.
Run a mapping service for the current scenario.
Note:  If a mapping's status is Invalid, the macro is not executed and is displayed in the audit log.
  • RunMapping ("Finance","","","")
  • RunMapping ("Finance", "Budgets to Demand","","")
  • RunMapping ("Finance", "Budgets to Demand", "FREV","")
  • RunMapping ("Finance", "Budgets to Demand","","ItemGroup.GOO")
SuperSession Code List, Predecessor Item Attribute, Successor Item Attribute, Location Attribute, Changeover Date Attribute, Transfer Factor Attribute, Introduction Date Measure Code, Discontinuation Date Measure Code, From Measure Code, To Measure Code, [Item Hierarchy Node], [Location Hierarchy Node] Performs the supersession logic for the current scenario. The supersession definitions are stored in a code list. When you execute the macro, the changeover date is set and the historical measure data is copied from the predecessor to the successor items, at the specified locations, for the cycle period horizon.
  • Supersession("Supersession list", "Predecessor Item", "Successor Item", "Location", "Changeover Date", "Factor", "FINTRO", "FDISCON", "HDMD", "HCOPYDMD","","")
    • Performs supersession for the definitions in supersession list, applying the changeover date to FINTRO for the successors and FDISCON for the predecessors; copying "HDMD" from all predecessor items to "HCOPYDMD" of all the successor items, at all specified locations, in the code list.
CopyMIEvent Source Cycle, [Source Cycle Period], [Source module], Source Scenario Name, [Source Measure Code], [Item Hierarchy Node], [Location Hierarchy Node], [Period label], [Destination Measure Code], [Reference] Copy the Approved and Pending Market Intelligence Events from the source to the destination. Pending events (which are editable scenarios) are only be copied, if the user is assigned access to the editable share of the source Scenario. MI events are used to copy the Market Intelligence Measures, the Market Intelligence Event, and the note created for the MI Event.
  • CopyMIEvent("Normal","May16,"","Demand-Baseline","","All Items","UK","FY 2016","","Supplier MI")

    Copy all valid MI Events with a reference to Supplier MI, from the Demand-Baseline in the Normal May16 cycle period to the current scenario for all items at UK for FY 2016 location. All events at and below UK location, All Items, and FY 2016 rows, including the splashed MI values for the measure are copied. Any notes for the events are also copied.

  • CopyMIEvent("Normal","May11","","Finance-Baseline","MI_1","","","","","")

    Copy all Events created for the MI_1 measure from Finance-Baseline in the cycle period Normal May11 to the current scenario for all items at all locations for the cycle period horizon. All MI_1 Events as well as the splashed MI values for the MI_1 measure will be copied. Any Notes for those Events are also copied.

  • CopyMIEvent("Normal","May11","","Finance-Baseline","MI_1","","","","MI_2","")

    Copy all events created for the MI_1 measure from the Finance-Baseline in the cycle period Normal May11 to the current scenario for items, at all locations for the cycle period horizon to the MI_2 measure. All MI_1 Events as well as the splashed MI values for the MI_1 measure will be copied to the MI measure MI_2. Any Notes for those Events arel also copied.

DeleteMIEvent [Measure Code], [Item Hierarchy Node], [Location Hierarchy Node], [Period label], [Tag], [Reference] Delete MI Events and clear the data from a specified measure in a scenario or from all MI Measures for all dimensions; or optionally for a specific item, location, period, or specified tag.
  • DeleteMIEvent("","","","","","")

    Deletes all MI Events (including notes linked to the events). Also, clears all MI measures for items at all locations, for all periods of the cycle period horizon.

  • DeleteMIEvent("DPLS_MI","","","","","")

    Deletes all MI Events created using the DPLS_MI measure. Also, clears the data in DPLS_MI and deletes any notes created for these Events for items at all locations, for all periods of the cycle period horizon.

  • DeleteMIEvent("","GOO","","","","")

    Deletes all MI Events (including notes linked to the events). Also, clears all MI measures events created for GOO items (and events created for items below GOO) at all locations for the cycle period horizon.

  • DeleteMIEvent("","","All DCs","","","")

    Deletes all MI Events (including notes linked to the events). Also, clears MI measures for events created for All Items for the location, All DCs (and events created for locations below All DCs) for the cycle period horizon.

  • DeleteMIEvent("","","","FY 10","","")

    Deletes all MI Events (including any notes linked to the Events) and clears all MI measures for all items at all locations for the duration of the calendar period "FY 10" (Events starting and Ending within the calendar period "FY 10"). that is, any Events beginning and ending within the calendar period "FY 10" are removed.

  • DeleteMIEvent("DPLS_MI","GOO","US","Current Year","","Easter MI")

    Deletes all MI Events which have a reference "Easter MI" created against the DPLS_MI measure, clears the DPLS_MI of data and deletes any notes created against those Events for GOO items (and any events created at items below GOO) at location "US" (and any events created at locations below US) for the duration of the calendar period "Current Year" (Events starting and Ending within the calendar period "Current Year").

  • DeleteMIEvent("","GOO","US","Current Year","DPLS_AdvanceForecasting","Easter MI")

    Deletes all MI Events which have a reference "Easter MI" created against any measures which are tagged against DPLS_AdvanceForecasting, clears the measures of data and deletes any notes created against those Events for GOO items (and any events created at items below GOO) at location "US" (and any events created at locations below US) for the duration of the calendar period "Current Year" (Events starting and Ending within the calendar period "Current Year").