[Mondrian] VBA functions / IIF

Matt Campbell mkambol at gmail.com
Tue Feb 13 10:20:48 EST 2007


The functions we've identified as required are:

LEFT
LEN
UCASE
INSTR
mid

Since we're implementing MID and LEFT I expect we'd also handle Substring
while we're at it, since they provide the same functionality.


On 2/12/07, Julian Hyde <julianhyde at speakeasy.net> wrote:
>
>  Matt,
>
> Can you give me a list of functions you need? Already on my list (see
> http://mondrian.pentaho.org/documentation/roadmap.html#Feature_Standard_functions)
> are:
>
>    - Cint(String) returns Number *
>    - CStr(Number) returns String *
>    - Power(Number, Number) returns Number
>    - Log(Number) returns Number
>    - Sqrt(Number) returns Number
>    - Substring(String, Integer) returns String
>    -  Substring(String, Integer, Integer) returns String
>    - Trim
>
> * CInt and CStr are subsumed by the Cast operator which I implemented
> recently, but will help people to run MDX queries unchanged.
>
> See further comments inline.
>
> Julian
>
>  ------------------------------
> *From:* mondrian-bounces at pentaho.org [mailto:mondrian-bounces at pentaho.org]
> *On Behalf Of *Matt Campbell
> *Sent:* Friday, February 09, 2007 8:26 AM
> *To:* Mondrian developer mailing list
> *Subject:* [Mondrian] VBA functions / IIF
>
>
> The client tool we're using (Cognos) issues some vba functions in its MDX
> occasionally:  INSTR, MID, LEN, etc.  We've been considering how best to
> deal with it.  We could just create some UDFs that mimic what the vba
> function does, but we could also create them as builtin Mondrian functions.
> Does anyone have an opinion?
>
>  I'd prefer that functions like this are implemented as UDFs.
> mondrian.udf.ValUdf is an example (implemented by Gang Chen) of a VB
> function implemented in this way.
>
> Even though they are implemented as UDFs, these functions would be
> available out-of-the-box. Include them in
> src/main/META-INF/services/mondrian.spi.UserDefinedFunction and they will be
> picked up automatically.
>
> As usual, we need a handful of testcases in FunctionTest for each
> function.
>
>
>
> We also plan on overriding IIF to support some additional parameter
> types.  Right now IIF supports iif( <logical expression>, <string>,<string>)
> and iif(<logical expression>,<number>,<number>).  We'd like to add
> iif(exp,value, str), iif(exp,str, value), iif(exp,value, value).  All of
> these permutations are supported by AS2K.
>
>
>  You're welcome to add other overloads to Iif. Iif is currently a builtin
> function, and it should stay that way.
>
> Julian
>
> _______________________________________________
> Mondrian mailing list
> Mondrian at pentaho.org
> http://lists.pentaho.org/mailman/listinfo/mondrian
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.pentaho.org/pipermail/mondrian/attachments/20070213/cb8ce078/attachment.html 


More information about the Mondrian mailing list