Create Function

Create or re-create your own registered Analytic Services calculation function, using a Java method. Minimum permission required: Application designer to create a local (application-level) function. Supervisor to create a global (system-level) function.

Process to follow:

  1. Develop the functions in Java classes.
  2. Use create function to register them in the Analytic Services calculator framework.
  3. You can now use the functions in the same way that you use the standard Analytic Services calculation functions.

Syntax

Notes

Examples

CREATE FUNCTION '@COVARIANCE' AS 'com.hyperion.essbase.calculator.Statistics.covariance' SPEC '@COVARIANCE (expList1, expList2)' COMMENT 'computes covariance of two sequences given as expression lists';

Descriptions

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

Key Phrase Explanation
create function as Register with Analytic Services a custom-defined function developed in Java, either as a global function usable by the entire Analytic Server, or as a local function available to an application. To register a global (server-wide) function, use one token for FUNC-NAME. To register a local (application-wide) function, use two tokens for FUNC-NAME.
create or replace function as Register with Analytic Services a global or local custom-defined function. If a function with that name already exists in the custom-defined function and macro catalog, it is replaced.
spec Enter, for the custom-defined function, an optional Analytic Services calculator-syntax specification string, such as in the following example: @COVARIANCE (expList1, expList2). Use a specification string if you wish the function 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.
with property runtime

Designate the custom-defined function as a runtime function. Normally, Analytic Services pre-executes functions whose arguments are available at compilation time. The Runtime property prevents that optimization, executing functions that have constant values as operands (or no operands at all) for every block in the function range. If the built-in @CALCMODE(CELL) function is used, a custom-defined function declared as Runtime can execute on every cell in the range.

Note: No built-in Analytic Services calculator functions have the Runtime property.

The Runtime property should be applied only in special circumstances, as it can seriously affect performance. The runtime property might be desirable for any custom-defined function whose return value depends on something besides its arguments; for example, the current date, or values in a rapidly changing relational table. If you created a runtime function @RANDOM() that returns a new random number each time it executes, then a member formula such as "Mem1 = @RANDOM();" would return different values for each block. At compilation time, the Runtime property prevents the pre-execution of functions that are applied to constants.

comment Create a description of the function (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