/* <maxl version="7.0.0" encoding="UTF-8"/> */ /** * This script registers methods of the class Statistics as global custom-defined functions * Usage: Log in to MaxL Shell, then call: msh reglobal.mxl * Author: Alex Russakovskii, Hyperion Solutions Corporation */ /** * Register function average */ CREATE FUNCTION '@JAVG' AS 'com.hyperion.essbase.calculator.Statistics.avg(double [])' SPEC '@JAVG(expList)' COMMENT 'Computes the average of non-missing values in a data set (expList)'; /** * Register function weighted average */ CREATE FUNCTION '@JAVGW' AS 'com.hyperion.essbase.calculator.Statistics.avg(double [],double [])' SPEC '@JAVGW(expList, weightExpList)' COMMENT 'Computes the weighted average of non-missing values in a data set (expList)'; /** * Register functions average and weighted average with a skip instruction. * These functions will be used through macros, so no spec/comment specified. * Since these functions will not be used directly, the names start with '@_'. */ CREATE FUNCTION '@_JAVGS' AS 'com.hyperion.essbase.calculator.Statistics.avg(int,double [])'; CREATE FUNCTION '@_JAVGWS' AS 'com.hyperion.essbase.calculator.Statistics.avg(int,double [],double [])'; /** * Register macro for average with a skip instruction */ CREATE MACRO '@JAVGS'(SINGLE,GROUP) AS '@@IFSTRCMP (@@1, SKIPNONE) @_JAVGS (0, @@2) @@ELSE @@IFSTRCMP (@@1, SKIPMISSING) @_JAVGS (1, @@2) @@ELSE @@IFSTRCMP (@@1, SKIPZERO) @_JAVGS (2, @@2) @@ELSE @@IFSTRCMP (@@1, SKIPBOTH) @_JAVGS (3, @@2) @@ELSE @@ERROR (@@L1, @_INVALIDSKIP) @@ENDIF @@ENDIF @@ENDIF @@ENDIF' SPEC '@JAVGS(SKIPNONE|SKIPZERO|SKIPMISSING|SKIPBOTH, expList)' COMMENT 'Computes the average value of a data set (expList) with skip instructions'; /** * Register macro for weighted average with a skip instruction */ CREATE MACRO '@JAVGWS'(SINGLE,SINGLE,SINGLE) AS '@@IFSTRCMP (@@1, SKIPNONE) @_JAVGWS (0, @@2, @@3) @@ELSE @@IFSTRCMP (@@1, SKIPMISSING) @_JAVGWS (1, @@2, @@3) @@ELSE @@IFSTRCMP (@@1, SKIPZERO) @_JAVGWS (2, @@2, @@3) @@ELSE @@IFSTRCMP (@@1, SKIPBOTH) @_JAVGS (3, @@2, @@3) @@ELSE @@ERROR (@@L1, @_INVALIDSKIP) @@ENDIF @@ENDIF @@ENDIF @@ENDIF' SPEC '@JAVGWS(SKIPNONE|SKIPZERO|SKIPMISSING|SKIPBOTH, expList, weightExpList)' COMMENT 'Computes the weighted average value of a data set (expList) with skip instructions'; /** * Register function correlation */ CREATE FUNCTION '@JCORR' AS 'com.hyperion.essbase.calculator.Statistics.correlation(double [],double [])' SPEC '@JCORR(expList1, expList2)' COMMENT 'Computes the correlation coefficient between two data sets (expList1 and expList2)'; /** * Register function weighted correlation */ CREATE FUNCTION '@JCORRW' AS 'com.hyperion.essbase.calculator.Statistics.correlation(double [],double [],double [])' SPEC '@JCORRW(expList1, expList2, weightExpList)' COMMENT 'Computes the weighted correlation coefficient between two data sets (expList1 and expList2)'; /** * Register function count */ CREATE FUNCTION '@JCOUNT' AS 'com.hyperion.essbase.calculator.Statistics.count(double [])' SPEC '@JCOUNT(expList)' COMMENT 'Computes the count of non-missing elements in a data set (expList)'; /** * Register function count with a skip instruction. * This function will be used through macros, so no spec/comment specified. * Since this function will not be used directly, the name starts with '@_'. */ CREATE FUNCTION '@_JCOUNTS' AS 'com.hyperion.essbase.calculator.Statistics.count(int,double [])'; /** * Register macro for count with a skip instruction */ CREATE MACRO '@JCOUNTS'(SINGLE,GROUP) AS '@@IFSTRCMP (@@1, SKIPNONE) @_JCOUNTS (0, @@2) @@ELSE @@IFSTRCMP (@@1, SKIPMISSING) @_JCOUNTS (1, @@2) @@ELSE @@IFSTRCMP (@@1, SKIPZERO) @_JCOUNTS (2, @@2) @@ELSE @@IFSTRCMP (@@1, SKIPBOTH) @_JCOUNTS (3, @@2) @@ELSE @@ERROR (@@L1, @_INVALIDSKIP) @@ENDIF @@ENDIF @@ENDIF @@ENDIF' SPEC '@JCOUNTS(SKIPNONE|SKIPZERO|SKIPMISSING|SKIPBOTH, expList)' COMMENT 'Computes the number of elements of a data set (expList) with skip instructions'; /** * Register function covariance */ CREATE FUNCTION '@JCOVAR' AS 'com.hyperion.essbase.calculator.Statistics.covariance(double [],double [])' SPEC '@JCOVAR(expList1, expList2)' COMMENT 'Computes the covariance between two data sets (expList1 and expList2)'; /** * Register function weighted covariance */ CREATE FUNCTION '@JCOVARW' AS 'com.hyperion.essbase.calculator.Statistics.covariance(double [],double [],double [])' SPEC '@JCOVARW(expList1, expList2, weightExpList)' COMMENT 'Computes the weighted covariance between two data sets (expList1 and expList2)'; /** * Register function geometric mean */ CREATE FUNCTION '@JGEOMEAN' AS 'com.hyperion.essbase.calculator.Statistics.geomean(double [])' SPEC '@JGEOMEAN(expList)' COMMENT 'Computes the geometric mean of a data set (expList)'; /** * Register function weighted geometric mean */ CREATE FUNCTION '@JGEOMEANW' AS 'com.hyperion.essbase.calculator.Statistics.geomean(double [],double [])' SPEC '@JGEOMEANW(expList, weightExpList)' COMMENT 'Computes the weighted geometric mean of a data set (expList)'; /** * Register function harmonic mean */ CREATE FUNCTION '@JHARMEAN' AS 'com.hyperion.essbase.calculator.Statistics.harmean(double [])' SPEC '@JHARMEAN(expList)' COMMENT 'Computes the harmonic mean of a data set (expList)'; /** * Register function weighted harmonic mean */ CREATE FUNCTION '@JHARMEANW' AS 'com.hyperion.essbase.calculator.Statistics.harmean(double [],double [])' SPEC '@JHARMEANW(expList, weightExpList)' COMMENT 'Computes the weighted harmonic mean of a data set (expList)'; /** * Register function kurtosis */ CREATE FUNCTION '@JKURT' AS 'com.hyperion.essbase.calculator.Statistics.kurt(double [])' SPEC '@JKURT(expList)' COMMENT 'Computes the kurtosis of a data set (expList)'; /** * Register function weighted kurtosis */ CREATE FUNCTION '@JKURTW' AS 'com.hyperion.essbase.calculator.Statistics.kurt(double [],double [])' SPEC '@JKURTW(expList, weightExpList)' COMMENT 'Computes the weighted kurtosis of a data set (expList)'; /** * Register function max * There is only one function with this name, so no need to specify the signature */ CREATE FUNCTION '@JMAX' AS 'com.hyperion.essbase.calculator.Statistics.max' SPEC '@JMAX(expList)' COMMENT 'Computes the maximum of a data set (expList)'; /** * Register function median * There is only one function with this name, so no need to specify the signature */ CREATE FUNCTION '@JMEDIAN' AS 'com.hyperion.essbase.calculator.Statistics.median' SPEC '@JMEDIAN(expList)' COMMENT 'Computes the median of a data set (expList)'; /** * Register function min * There is only one function with this name, so no need to specify the signature */ CREATE FUNCTION '@JMIN' AS 'com.hyperion.essbase.calculator.Statistics.min' SPEC '@JMIN(expList)' COMMENT 'Computes the minimum of a data set (expList)'; /** * Register function mode * There is only one function with this name, so no need to specify the signature */ CREATE FUNCTION '@JMODE' AS 'com.hyperion.essbase.calculator.Statistics.mode' SPEC '@JMODE(expList)' COMMENT 'Computes the mode of a data set (expList)'; /** * Register function percentile */ CREATE FUNCTION '@JPTILE' AS 'com.hyperion.essbase.calculator.Statistics.percentile(double,double [])' SPEC '@JPTILE(percent,expList)' COMMENT 'Computes the specified (percent) percentile of a data set (expList)'; /** * Register function product */ CREATE FUNCTION '@JPROD' AS 'com.hyperion.essbase.calculator.Statistics.product(double [])' SPEC '@JPROD(expList)' COMMENT 'Computes the product of non-missing values in a data set (expList)'; /** * Register function weighted product */ CREATE FUNCTION '@JPRODW' AS 'com.hyperion.essbase.calculator.Statistics.product(double [],double [])' SPEC '@JPRODW(expList, weightExpList)' COMMENT 'Computes the weighted product of non-missing values in a data set (expList)'; /** * Register function quartile * There is only one function with this name, so no need to specify the signature */ CREATE FUNCTION '@JQTILE' AS 'com.hyperion.essbase.calculator.Statistics.quartile' SPEC '@JQTILE(quart,expList)' COMMENT 'Computes the specified (quart) quartile of a data set (expList)'; /** * Register function rank * There is only one function with this name, so no need to specify the signature */ CREATE FUNCTION '@JRANK' AS 'com.hyperion.essbase.calculator.Statistics.rank' SPEC '@JRANK(value,expList)' COMMENT 'Computes the rank of a value in a data set (expList)'; /** * Register function skewness */ CREATE FUNCTION '@JSKEW' AS 'com.hyperion.essbase.calculator.Statistics.skew(double [])' SPEC '@JSKEW(expList)' COMMENT 'Computes the skewness of a data set (expList)'; /** * Register function weighted skewness */ CREATE FUNCTION '@JSKEWW' AS 'com.hyperion.essbase.calculator.Statistics.skew(double [],double [])' SPEC '@JSKEWW(expList, weightExpList)' COMMENT 'Computes the weighted skewness of a data set (expList)'; /** * Register function stdev */ CREATE FUNCTION '@JSTDEV' AS 'com.hyperion.essbase.calculator.Statistics.stdev(double [])' SPEC '@JSTDEV(expList)' COMMENT 'Computes the standard deviation of non-missing values in a data set (expList)'; /** * Register function weighted stdev */ CREATE FUNCTION '@JSTDEVW' AS 'com.hyperion.essbase.calculator.Statistics.stdev(double [],double [])' SPEC '@JSTDEVW(expList, weightExpList)' COMMENT 'Computes the weighted standard deviation of non-missing values in a data set (expList)'; /** * Register functions stdev and weighted stdev with a skip instruction. * These functions will be used through macros, so no spec/comment specified. * Since these functions will not be used directly, the names start with '@_'. */ CREATE FUNCTION '@_JSTDEVS' AS 'com.hyperion.essbase.calculator.Statistics.stdev(int,double [])'; CREATE FUNCTION '@_JSTDEVWS' AS 'com.hyperion.essbase.calculator.Statistics.stdev(int,double [],double [])'; /** * Register macro for stdev with a skip instruction */ CREATE MACRO '@JSTDEVS'(SINGLE,GROUP) AS '@@IFSTRCMP (@@1, SKIPNONE) @_JSTDEVS (0, @@2) @@ELSE @@IFSTRCMP (@@1, SKIPMISSING) @_JSTDEVS (1, @@2) @@ELSE @@IFSTRCMP (@@1, SKIPZERO) @_JSTDEVS (2, @@2) @@ELSE @@IFSTRCMP (@@1, SKIPBOTH) @_JSTDEVS (3, @@2) @@ELSE @@ERROR (@@L1, @_INVALIDSKIP) @@ENDIF @@ENDIF @@ENDIF @@ENDIF' SPEC '@JSTDEVS(SKIPNONE|SKIPZERO|SKIPMISSING|SKIPBOTH, expList)' COMMENT 'Computes the standard deviation value of a data set (expList) with skip instructions'; /** * Register macro for weighted standard deviation with a skip instruction */ CREATE MACRO '@JSTDEVWS'(SINGLE,SINGLE,SINGLE) AS '@@IFSTRCMP (@@1, SKIPNONE) @_JSTDEVWS (0, @@2, @@3) @@ELSE @@IFSTRCMP (@@1, SKIPMISSING) @_JSTDEVWS (1, @@2, @@3) @@ELSE @@IFSTRCMP (@@1, SKIPZERO) @_JSTDEVWS (2, @@2, @@3) @@ELSE @@IFSTRCMP (@@1, SKIPBOTH) @_JSTDEVS (3, @@2, @@3) @@ELSE @@ERROR (@@L1, @_INVALIDSKIP) @@ENDIF @@ENDIF @@ENDIF @@ENDIF' SPEC '@JSTDEVWS(SKIPNONE|SKIPZERO|SKIPMISSING|SKIPBOTH, expList, weightExpList)' COMMENT 'Computes the weighted standard deviation value of a data set (expList) with skip instructions'; /** * Register function stdevp */ CREATE FUNCTION '@JSTDEVP' AS 'com.hyperion.essbase.calculator.Statistics.stdevp(double [])' SPEC '@JSTDEVP(expList)' COMMENT 'Computes the standard deviation(p) of non-missing values in a data set (expList)'; /** * Register function weighted stdevp */ CREATE FUNCTION '@JSTDEVPW' AS 'com.hyperion.essbase.calculator.Statistics.stdevp(double [],double [])' SPEC '@JSTDEVPW(expList, weightExpList)' COMMENT 'Computes the weighted standard deviation(p) of non-missing values in a data set (expList)'; /** * Register functions stdevp and weighted stdevp with a skip instruction. * These functions will be used through macros, so no spec/comment specified. * Since these functions will not be used directly, the names start with '@_'. */ CREATE FUNCTION '@_JSTDEVPS' AS 'com.hyperion.essbase.calculator.Statistics.stdevp(int,double [])'; CREATE FUNCTION '@_JSTDEVPWS' AS 'com.hyperion.essbase.calculator.Statistics.stdevp(int,double [],double [])'; /** * Register macro for stdevp with a skip instruction */ CREATE MACRO '@JSTDEVPS'(SINGLE,GROUP) AS '@@IFSTRCMP (@@1, SKIPNONE) @_JSTDEVPS (0, @@2) @@ELSE @@IFSTRCMP (@@1, SKIPMISSING) @_JSTDEVPS (1, @@2) @@ELSE @@IFSTRCMP (@@1, SKIPZERO) @_JSTDEVPS (2, @@2) @@ELSE @@IFSTRCMP (@@1, SKIPBOTH) @_JSTDEVPS (3, @@2) @@ELSE @@ERROR (@@L1, @_INVALIDSKIP) @@ENDIF @@ENDIF @@ENDIF @@ENDIF' SPEC '@JSTDEVPS(SKIPNONE|SKIPZERO|SKIPMISSING|SKIPBOTH, expList)' COMMENT 'Computes the standard deviation(p) value of a data set (expList) with skip instructions'; /** * Register macro for weighted stdevp with a skip instruction */ CREATE MACRO '@JSTDEVPWS'(SINGLE,SINGLE,SINGLE) AS '@@IFSTRCMP (@@1, SKIPNONE) @_JSTDEVPWS (0, @@2, @@3) @@ELSE @@IFSTRCMP (@@1, SKIPMISSING) @_JSTDEVPWS (1, @@2, @@3) @@ELSE @@IFSTRCMP (@@1, SKIPZERO) @_JSTDEVPWS (2, @@2, @@3) @@ELSE @@IFSTRCMP (@@1, SKIPBOTH) @_JSTDEVPS (3, @@2, @@3) @@ELSE @@ERROR (@@L1, @_INVALIDSKIP) @@ENDIF @@ENDIF @@ENDIF @@ENDIF' SPEC '@JSTDEVPWS(SKIPNONE|SKIPZERO|SKIPMISSING|SKIPBOTH, expList, weightExpList)' COMMENT 'Computes the weighted standard deviation(p) value of a data set (expList) with skip instructions'; /** * Register function sum */ CREATE FUNCTION '@JSUM' AS 'com.hyperion.essbase.calculator.Statistics.sum(double [])' SPEC '@JSUM(expList)' COMMENT 'Computes the sum of a data set (expList)'; /** * Register function weighted SUM */ CREATE FUNCTION '@JSUMW' AS 'com.hyperion.essbase.calculator.Statistics.sum(double [],double [])' SPEC '@JSUMW(expList, weightExpList)' COMMENT 'Computes the weighted sum of a data set (expList)'; /** * Register function var */ CREATE FUNCTION '@JVAR' AS 'com.hyperion.essbase.calculator.Statistics.var(double [])' SPEC '@JVAR(expList)' COMMENT 'Computes the variance of non-missing values in a data set (expList)'; /** * Register function weighted var */ CREATE FUNCTION '@JVARW' AS 'com.hyperion.essbase.calculator.Statistics.var(double [],double [])' SPEC '@JVARW(expList, weightExpList)' COMMENT 'Computes the weighted variance of non-missing values in a data set (expList)'; /** * Register functions var and weighted var with a skip instruction. * These functions will be used through macros, so no spec/comment specified. * Since these functions will not be used directly, the names start with '@_'. */ CREATE FUNCTION '@_JVARS' AS 'com.hyperion.essbase.calculator.Statistics.var(int,double [])'; CREATE FUNCTION '@_JVARWS AS 'com.hyperion.essbase.calculator.Statistics.var(int,double [],double [])'; /** * Register macro for var with a skip instruction */ CREATE MACRO '@JVARS'(SINGLE,GROUP) AS '@@IFSTRCMP (@@1, SKIPNONE) @_JVARS (0, @@2) @@ELSE @@IFSTRCMP (@@1, SKIPMISSING) @_JVARS (1, @@2) @@ELSE @@IFSTRCMP (@@1, SKIPZERO) @_JVARS (2, @@2) @@ELSE @@IFSTRCMP (@@1, SKIPBOTH) @_JVARS (3, @@2) @@ELSE @@ERROR (@@L1, @_INVALIDSKIP) @@ENDIF @@ENDIF @@ENDIF @@ENDIF' SPEC '@JVARS(SKIPNONE|SKIPZERO|SKIPMISSING|SKIPBOTH, expList)' COMMENT 'Computes the variance value of a data set (expList) with skip instructions'; /** * Register macro for weighted variance with a skip instruction */ CREATE MACRO '@JVARWS'(SINGLE,SINGLE,SINGLE) AS '@@IFSTRCMP (@@1, SKIPNONE) @_JVARWS (0, @@2, @@3) @@ELSE @@IFSTRCMP (@@1, SKIPMISSING) @_JVARWS (1, @@2, @@3) @@ELSE @@IFSTRCMP (@@1, SKIPZERO) @_JVARWS (2, @@2, @@3) @@ELSE @@IFSTRCMP (@@1, SKIPBOTH) @_JVARS (3, @@2, @@3) @@ELSE @@ERROR (@@L1, @_INVALIDSKIP) @@ENDIF @@ENDIF @@ENDIF @@ENDIF' SPEC '@JVARWS(SKIPNONE|SKIPZERO|SKIPMISSING|SKIPBOTH, expList, weightExpList)' COMMENT 'Computes the weighted variance value of a data set (expList) with skip instructions'; /** * Register function varp */ CREATE FUNCTION '@JVARP' AS 'com.hyperion.essbase.calculator.Statistics.varp(double [])' SPEC '@JVARP(expList)' COMMENT 'Computes the variance(p) of non-missing values in a data set (expList)'; /** * Register function weighted varp */ CREATE FUNCTION '@JVARPW' AS 'com.hyperion.essbase.calculator.Statistics.varp(double [],double [])' SPEC '@JVARPW(expList, weightExpList)' COMMENT 'Computes the weighted variance(p) of non-missing values in a data set (expList)'; /** * Register functions varp and weighted varp with a skip instruction. * These functions will be used through macros, so no spec/comment specified. * Since these functions will not be used directly, the names start with '@_'. */ CREATE FUNCTION '@_JVARPS' AS 'com.hyperion.essbase.calculator.Statistics.varp(int,double [])'; CREATE FUNCTION '@_JVARPWS' AS 'com.hyperion.essbase.calculator.Statistics.varp(int,double [],double [])'; /** * Register macro for varp with a skip instruction */ CREATE MACRO '@JVARPS'(SINGLE,GROUP) AS '@@IFSTRCMP (@@1, SKIPNONE) @_JVARPS (0, @@2) @@ELSE @@IFSTRCMP (@@1, SKIPMISSING) @_JVARPS (1, @@2) @@ELSE @@IFSTRCMP (@@1, SKIPZERO) @_JVARPS (2, @@2) @@ELSE @@IFSTRCMP (@@1, SKIPBOTH) @_JVARPS (3, @@2) @@ELSE @@ERROR (@@L1, @_INVALIDSKIP) @@ENDIF @@ENDIF @@ENDIF @@ENDIF' SPEC '@JVARPS(SKIPNONE|SKIPZERO|SKIPMISSING|SKIPBOTH, expList)' COMMENT 'Computes the variance(p) value of a data set (expList) with skip instructions'; /** * Register macro for weighted varp with a skip instruction */ CREATE MACRO '@JVARPWS'(SINGLE,SINGLE,SINGLE) AS '@@IFSTRCMP (@@1, SKIPNONE) @_JVARPWS (0, @@2, @@3) @@ELSE @@IFSTRCMP (@@1, SKIPMISSING) @_JVARPWS (1, @@2, @@3) @@ELSE @@IFSTRCMP (@@1, SKIPZERO) @_JVARPWS (2, @@2, @@3) @@ELSE @@IFSTRCMP (@@1, SKIPBOTH) @_JVARPS (3, @@2, @@3) @@ELSE @@ERROR (@@L1, @_INVALIDSKIP) @@ENDIF @@ENDIF @@ENDIF @@ENDIF' SPEC '@JVARPWS(SKIPNONE|SKIPZERO|SKIPMISSING|SKIPBOTH, expList, weightExpList)' COMMENT 'Computes the weighted variance(p) value of a data set (expList) with skip instructions';
©2004 Hyperion Solutions Corporation. All Rights Reserved. http://www.hyperion.com |