EmailWorksheet macro

The EmailWorksheet macro is used to load the worksheet with passed context (item, location and period) and email the worksheet to the user. This macro is executed at scenario level.

The macro parameters determine the context and worksheet to be emailed. The multi panel worksheets are not supported in this macro.

For executing the macro, the value for the Command field must be specified in this format:

EmailWorksheet (Export type, Worksheet Name, User, [Item Passed], [Location Passed], [Period Passed]).
Note: The optional parameters are specified in [ ].

This table lists the parameters used to execute the EmailWorksheet macro:

Parameter Name Description
Export Type The format of file in which the worksheet is to be sent. Possible options:
  • PDF
  • XLS
Worksheet Name The name of the worksheet to execute and email.
User The email recipient for the worksheet.
Note: The user must have access to the worksheet.
Item Passed The item selection passed to the worksheet. This value can be a single element or set of elements.
Note: 
  • MDX definition is supported for set of elements.
  • If this value is not specified, the default worksheet definition (if defined) is used, else the top node of the default hierarchy is used.
  • You can use %itemcontext%, if the current item data context is required (This parameter is applicable only when the command is executed within a worksheet).
Location Passed The location selection passed to the worksheet. This value can be a single element or set of elements.
Note: 
  • MDX definition is supported for set of elements.
  • If this value is not specified, the default worksheet definition (if defined) is used, else the top node of the default hierarchy is used.
  • You can use %locationcontext%, if the current location data context is required (This parameter is applicable only when the command is executed within a worksheet)..
Period Passed The period selection passed to the worksheet. This value can be a single element or set of elements.
Note: 
  • MDX definition is supported for set of elements.
  • If this value is not specified, the default worksheet definition (if defined) is used, else the top node of the default hierarchy is used.
  • You can use %periodcontext%, if the current period data context is required (This parameter is applicable only when the command is executed within a worksheet).

This table lists examples of the EmailWorksheet macro:

Requirement Syntax
Execute Demand Margin Analysis worksheet with default item, location and period selection from worksheet definition and email the PDF output to user ‘Scott’.

EmailWorksheet("PDF","Demand Margin Analysis","Scott").

EmailWorksheet("PDF","Demand Margin Analysis","Scott","","","").

Execute Demand Essentials worksheet with default item, location and period selection from worksheet definition and email the XLS output to user ‘Harry’. EmailWorksheet("XLS","Demand Essentials","Harry","","","").
Execute Forecast Accuracy Analysis worksheet with Brand A item node, default location selection and Rolling Weeks period node and email the PDF output to user ‘Harry’. EmailWorksheet("PDF","Forecast Accuracy Analysis","Harry","Brand A","","Rolling Weeks").