Create Macro

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

Syntax

Notes

Examples

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';

Descriptions

Use create macro to create a macro in the following ways:

Key Phrase Explanation
create macro as Create and register with Analytic Services 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 Analytic 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 Analytic Services 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.
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 EssListCalcFunctions API function.

©2004 Hyperion Solutions Corporation. All Rights Reserved.
http://www.hyperion.com