Hitachi Vantara Pentaho Community Forums
Results 1 to 6 of 6

Thread: [Mondrian] Numeric Member autoformat problem

  1. #1
    mehdi b Guest

    Default [Mondrian] Numeric Member autoformat problem

    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 (DOT) org
    http://lists.pentaho.org/mailman/listinfo/mondrian

  2. #2
    Luc Boudreau Guest

    Default 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 (DOT) 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 (DOT) org
    > http://lists.pentaho.org/mailman/listinfo/mondrian
    >
    >


    _______________________________________________
    Mondrian mailing list
    Mondrian (AT) pentaho (DOT) org
    http://lists.pentaho.org/mailman/listinfo/mondrian

  3. #3
    Julian Hyde Guest

    Default RE: [Mondrian] Numeric Member autoformat problem

    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 <http://mondrian.pentaho.com/documentation/schema.php#XML_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 (DOT) org [mailto:mondrian-bounces (AT) pentaho (DOT) 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 (DOT) 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 (DOT) org
    http://lists.pentaho.org/mailman/listinfo/mondrian





    _______________________________________________
    Mondrian mailing list
    Mondrian (AT) pentaho (DOT) org
    http://lists.pentaho.org/mailman/listinfo/mondrian

  4. #4
    Andy Grohe Guest

    Default Re: [Mondrian] Numeric Member autoformat problem

    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 (DOT) 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 (DOT) org [mailto:mondrian-bounces (AT) pentaho (DOT) 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 (DOT) 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 (DOT) org
    > http://lists.pentaho.org/mailman/listinfo/mondrian
    >
    >
    > _______________________________________________
    > Mondrian mailing list
    > Mondrian (AT) pentaho (DOT) org
    > http://lists.pentaho.org/mailman/listinfo/mondrian


    _______________________________________________
    Mondrian mailing list
    Mondrian (AT) pentaho (DOT) org
    http://lists.pentaho.org/mailman/listinfo/mondrian

  5. #5
    Luc Boudreau Guest

    Default Re: [Mondrian] Numeric Member autoformat problem

    Now all we need is a first implementer ;o)



    On Wed, May 11, 2011 at 3:02 PM, Andy Grohe <agrohe21 (AT) gmail (DOT) com> wrote:

    > 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 (DOT) 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 <http://mondrian.pentaho.com/documentation/schema.php#XML_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 (DOT) org [mailto:mondrian-bounces (AT) pentaho (DOT) 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 (DOT) com>
    > mehdi_xinu (AT) yahoo (DOT) 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 (DOT) org>Mondrian (AT) pentaho (DOT) org
    >> <http://lists.pentaho.org/mailman/listinfo/mondrian>
    >> http://lists.pentaho.org/mailman/listinfo/mondrian
    >>
    >>

    > _______________________________________________
    > Mondrian mailing list
    > Mondrian (AT) pentaho (DOT) org
    > http://lists.pentaho.org/mailman/listinfo/mondrian
    >
    >
    > _______________________________________________
    > Mondrian mailing list
    > Mondrian (AT) pentaho (DOT) org
    > http://lists.pentaho.org/mailman/listinfo/mondrian
    >
    >


    _______________________________________________
    Mondrian mailing list
    Mondrian (AT) pentaho (DOT) org
    http://lists.pentaho.org/mailman/listinfo/mondrian

  6. #6
    mehdi b Guest

    Default Re: [Mondrian] Numeric Member autoformat problem

    Hi,

    This is my schema:
    <Schema name="TypesMart">

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.