Create Macro
The MaxL create macro statement helps you 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
Description of the illustration cremacro.gif
Use create macro to create a macro in the following ways:
Keywords
- 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.
- 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. 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 IEssCube.getCalcFunctions Java method or EssListCalcFunctions C API function.Note:
If you do not specify a calculation specification string, you cannot specify a comment either.
- 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 IEssCube.getCalcFunctions Java method or EssListCalcFunctions C 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';