[Mondrian] Numeric Member autoformat problem

Andy Grohe agrohe21 at gmail.com
Wed May 11 15:02:49 EDT 2011


Now we are talking!  JavaScript in Mondrian schema.  I will be the first tester.

Sent from my iPhone

On May 11, 2011, at 1:50 PM, Julian Hyde <jhyde at pentaho.com> wrote:

> By the way. I've thought for some time that writing a MemberFormatter is an onerous solution to problems like these. (Write the java class, compile it, include it in a jar, add it to the schema.xml, rinse and repeat.) A good feature would be formatters (and other similar plugins) written in script.
>  
> In the schema file you could write
>  
> <Level column="column" name="name">
>    <FormatScript>return sprintf(member.key, "%0d")</FormatScript>
> </Level>
> and Mondrian would execute the included JavaScript whenever it needed to format the member.
>  
> It should allow for much more rapid iterative development. Contributions welcome...
>  
> Julian
> From: mondrian-bounces at pentaho.org [mailto:mondrian-bounces at pentaho.org] On Behalf Of Luc Boudreau
> Sent: Wednesday, May 11, 2011 9:47 AM
> To: Mondrian developer mailing list
> Subject: Re: [Mondrian] Numeric Member autoformat problem
> 
> Mehdi,
> 
> Can you copy paste your complete Level element configuration? Using a MemberFormatter is the way to go. Was there any exception message thrown by Mondrian telling you it failed to instantiate the MemberFormatter?
> 
> 
> 
> On Wed, May 11, 2011 at 6:35 AM, mehdi b <mehdi_xinu at yahoo.com>    wrote:
> Hi,
> 
> I'm using mondrian 3.2.1. I have a Level which is integer and it has 8 digits length, its definition is as follows:
> <Dimention name="TrxDate">
> <Hierarchy hasAll="true" allMemberName="All">
> <Level name="TrxDate" column="..." uniqueMembers="true"/>
> </Hierarchy>
> </Dimention>
> 
> when I want to use this dimension in query like
> SELECT {[Measures].{Trx]} on COLUMNS, {[TrxDate].[20110403]} on ROWS from [Types]
> 
> I encounter the error that [TrxDate].[20110403] not found, but when I run the query as
> SELECT {[Measures].{Trx]} on COLUMNS, {[TrxDate].[2.0110403E7]} on ROWS from [Types]
> 
> the query executed successfully. I don't know how Mondrian formatted the members?
> I also tried various types on the Level definition in schema like type="String" or type="Numeric" but the result is as the same. I also created a "MemberFormatter" and assigned it to the Level definition in schema, but it is not called.
> 
> I also tried the query
> SELECT {[Measures].{Trx]} on COLUMNS, {[TrxDate]} on ROWS            from [Types]
> 
> and then print the result through result.print() method and it seems that Mondrian load the members as scientific format.
> 
> I would appreciate any help!
> 
> 
> _______________________________________________
> Mondrian mailing list
> Mondrian at pentaho.org
> http://lists.pentaho.org/mailman/listinfo/mondrian
> 
> 
> _______________________________________________
> 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/20110511/0eb7e399/attachment.html 


More information about the Mondrian mailing list