Create or re-create your own Essbase calculation macro as your chosen combination of existing calculation functions or macros. This statement registers the new macro with the Essbase custom-defined function and macro catalog.
Minimum permission required: Application Manager to create a local (application-level) macro. Administrator to create a global (system-level) macro.
Syntax

Use create macro to create a macro in the following ways:
| Keyword | Description | ||
|---|---|---|---|
create macro as | Create and register with Essbase a custom-defined macro as your chosen combination of existing calculation functions or macros. Register the macro either as a global macro usable by the entire Essbase Server, or as a local macro available to an application. To register a global (server-wide) macro, use one token for MACRO-NAME. To register a local (application-wide) function, use two tokens for MACRO-NAME. | ||
create macro... <macro-signature> | Enter for the macro an optional signature defining the syntax rules for macro arguments. A macro signature describes the style in which arguments (or input parameters) to the macro may be passed. One example of a macro signature is (SINGLE, SINGLE, GROUP), meaning that the macro must be passed two comma-separated arguments followed by a list of arguments. For more information, see Custom-Defined Macro Input Parameters. | ||
create or replace macro | Register with Essbase a global or local custom-defined macro. If a macro with that name already exists in the custom-defined function and macro catalog, it is replaced. | ||
spec | Enter for the macro an optional calculator-syntax specification string, as in the following example: @MYMACRO (mbrName, rangeList). Use a specification string if you wish the macro to be returned by the output string of the EssListCalcFunctions API function.
| ||
comment | Create a description of the macro (optional). You cannot create a comment without also using spec to create a calculator-syntax specification string. The optional calculator-syntax specification string and the comment are used as the output string of the EssListCalcFunctions API function. |
Notes
To create a global (system-level) macro, use a single name for MACRO-NAME. For example, '@COVARIANCE'.
To create a local (application-level) macro, use MaxL's double naming convention for MACRO-NAME. For example, Sample.'@COVARIANCE'.
Example
create macro Sample.'@COVARIANCE'(single, single) as '@COUNT(SKIPMISSING,@RANGE(@@S))' spec '@COVARIANCE (expList1, expList2)' comment 'Computes covariance of two sequences given as expression lists';