Functions
icCube allows you to create new functions which are then available from within MDX queries as standard functions. For the sake of simplicity in their development, several kinds of user defined functions are available.
JAVA Functions
They're the simplest way to add functions. Those functions are implemented like regular JAVA classes having no dependency on OLAP data structure (e.g. cos(), sin(), etc.).
<javaFunctions moduleName="VBA"
className="crazydev.iccube.plugin.olapfunctions.excel.OlapVBExcelNumericalFunctions"
overwriteMain="false"
overwriteModule="false"/>
: Defines the module name (sort of namespace) of the functions (e.g. the function MID defined within the VBA module may be referenced as VBA!MID from within MDX queries).
: The JAVA class declaring the functions to add within the MDX engine. New functions are declared as static fields implementing the class .
: Allows you to replace existing MDX functions with the same names (without the module name).
: Allows you to replace existing MDX functions with the same names (with the module name).
The source code of the JAVA OlapVBExcelNumericalFunctions class is available in the icCube plugin as explained in the examples chapter.
OLAP Statistical Function
These functions allow you to implement statistics processing over a set of values.
<olapStatFunction mdxFunctionName="WAvg"
mdxFunctionDescription="Calculate Weighted Average"
className="crazydev.iccube.plugin.olapfunctions.stats.OlapWAvgFunction"
overwriteExisting="false"/>
: The name (as used in MDX queries) of the function.
: A short description of the purpose of the function.
: The JAVA class declaring the function to add within the MDX engine; two bases classes are available depending on the MDX signature of the functions.
: Use the JAVA base class: .
: use the JAVA base class : .
: Allows you to replace an existing MDX function with the same name.
The source code of the JAVA OlapWAvgFunction class is available in the icCube plugin as explained in the examples chapter.
OLAP Function
<olapFunction className="crazydev.iccube.plugin.olapfunctions.OlapStrToHierarchyFunction"
overwriteExisting="false"/>
: The JAVA class declaring the function to add within the MDX engine. The new class must implement the class .
: Allows you to replace an existing MDX function with the same name.
The source code of the JAVA OlapStrToHierarchyFunction class is available in the icCube plugin as explained in the examples chapter.
Next chapter : Types & Operators describes how to extend MDX with new types and operators.