Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: [Mondrian] Datatype in MDSCHEMA_MEASURES

  1. #1
    Matt Campbell Guest

    Default [Mondrian] Datatype in MDSCHEMA_MEASURES

    Calculated members appear to always have a datatype of WSTR (130) specified
    in the XMLA response. This looks like a bug. Anyone have additional
    information?

    <row>
    <CATALOG_NAME>FoodMart</CATALOG_NAME>
    <CUBE_NAME>Sales</CUBE_NAME>
    <MEASURE_NAME>Profit Growth</MEASURE_NAME>
    <MEASURE_UNIQUE_NAME>[Measures].[Profit
    Growth]</MEASURE_UNIQUE_NAME>
    <MEASURE_CAPTION>Gewinn-Wachstum</MEASURE_CAPTION>
    <MEASURE_AGGREGATOR>127</MEASURE_AGGREGATOR>
    <DATA_TYPE>130</DATA_TYPE>
    <MEASURE_IS_VISIBLE>true</MEASURE_IS_VISIBLE>
    <DESCRIPTION>Sales Cube - Profit Growth Member</DESCRIPTION>
    </row>

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

  2. #2
    Julian Hyde Guest

    Default RE: [Mondrian] Datatype in MDSCHEMA_MEASURES

    Here's the code, from RowsetDefinition.java:

    // DATA_TYPE DBType best guess is string
    int dbType = DBType.WSTR.userOrdinal;
    String datatype = (String)
    member.getPropertyValue(Property.DATATYPE.getName());
    if (datatype != null) {
    if (datatype.equals("Integer")) {
    dbType = DBType.I4.userOrdinal;
    } else if (datatype.equals("Numeric")) {
    dbType = DBType.R8.userOrdinal;
    } else {
    dbType = DBType.WSTR.userOrdinal;
    }
    }
    row.set(DataType.name, dbType);

    It suggests that you can override by setting the DATATYPE property of
    the calculated member to "Integer" or "Numeric".

    Julian


    _____

    From: mondrian-bounces (AT) pentaho (DOT) org [mailto:mondrian-bounces (AT) pentaho (DOT) org]
    On Behalf Of Matt Campbell
    Sent: Friday, March 23, 2007 11:56 AM
    To: mondrian (AT) pentaho (DOT) org
    Subject: [Mondrian] Datatype in MDSCHEMA_MEASURES



    Calculated members appear to always have a datatype of WSTR (130)
    specified in the XMLA response. This looks like a bug. Anyone have
    additional information?

    <row>
    <CATALOG_NAME>FoodMart</CATALOG_NAME>
    <CUBE_NAME>Sales</CUBE_NAME>
    <MEASURE_NAME>Profit Growth</MEASURE_NAME>
    <MEASURE_UNIQUE_NAME>[Measures].[Profit
    Growth]</MEASURE_UNIQUE_NAME>
    <MEASURE_CAPTION>Gewinn-Wachstum</MEASURE_CAPTION>
    <MEASURE_AGGREGATOR>127</MEASURE_AGGREGATOR>
    <DATA_TYPE>130</DATA_TYPE>
    <MEASURE_IS_VISIBLE>true</MEASURE_IS_VISIBLE>
    <DESCRIPTION>Sales Cube - Profit Growth Member</DESCRIPTION>
    </row>



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

  3. #3
    Matt Campbell Guest

    Default Re: [Mondrian] Datatype in MDSCHEMA_MEASURES

    I'll have to dig into this, but setting the datatype property of a
    <CalculatedMember> does not appear to have any
    effect--member.getPropertyValue() returns null in the block of code you
    snipped. Setting the datatype attribute of a <Measure> does have an effect,
    though.



    On 3/23/07, Julian Hyde <julianhyde (AT) speakeasy (DOT) net> wrote:
    >
    > Here's the code, from RowsetDefinition.java:
    >
    > // DATA_TYPE DBType best guess is string
    > int dbType = DBType.WSTR.userOrdinal;
    > String datatype = (String)
    > member.getPropertyValue(Property.DATATYPE.getName());
    > if (datatype != null) {
    > if (datatype.equals("Integer")) {
    > dbType = DBType.I4.userOrdinal;
    > } else if (datatype.equals("Numeric")) {
    > dbType = DBType.R8.userOrdinal;
    > } else {
    > dbType = DBType.WSTR.userOrdinal;
    > }
    > }
    > row.set(DataType.name, dbType);
    > It suggests that you can override by setting the DATATYPE property of the
    > calculated member to "Integer" or "Numeric".
    >
    > Julian
    >
    > ------------------------------
    > *From:* mondrian-bounces (AT) pentaho (DOT) org [mailto:mondrian-bounces (AT) pentaho (DOT) org]
    > *On Behalf Of *Matt Campbell
    > *Sent:* Friday, March 23, 2007 11:56 AM
    > *To:* mondrian (AT) pentaho (DOT) org
    > *Subject:* [Mondrian] Datatype in MDSCHEMA_MEASURES
    >
    >
    > Calculated members appear to always have a datatype of WSTR (130)
    > specified in the XMLA response. This looks like a bug. Anyone have
    > additional information?
    >
    > <row>
    > <CATALOG_NAME>FoodMart</CATALOG_NAME>
    > <CUBE_NAME>Sales</CUBE_NAME>
    > <MEASURE_NAME>Profit Growth</MEASURE_NAME>
    > <MEASURE_UNIQUE_NAME>[Measures].[Profit
    > Growth]</MEASURE_UNIQUE_NAME>
    > <MEASURE_CAPTION>Gewinn-Wachstum</MEASURE_CAPTION>
    > <MEASURE_AGGREGATOR>127</MEASURE_AGGREGATOR>
    > <DATA_TYPE>130</DATA_TYPE>
    > <MEASURE_IS_VISIBLE>true</MEASURE_IS_VISIBLE>
    > <DESCRIPTION>Sales Cube - Profit Growth Member</DESCRIPTION>
    > </row>
    >
    >
    > _______________________________________________
    > 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
    Matt Campbell Guest

    Default Re: [Mondrian] Datatype in MDSCHEMA_MEASURES

    It was a case error on my part, the following worked fine:

    <CalculatedMemberProperty name="DATATYPE" value="Numeric" />

    I can add this detail to the Calculated Member section of the schema
    documentation if you think it's appropriate.


    On 3/26/07, Matt Campbell <mkambol (AT) gmail (DOT) com> wrote:
    >
    >
    > I'll have to dig into this, but setting the datatype property of a
    > <CalculatedMember> does not appear to have any
    > effect--member.getPropertyValue() returns null in the block of code you
    > snipped. Setting the datatype attribute of a <Measure> does have an effect,
    > though.
    >
    >
    >
    > On 3/23/07, Julian Hyde <julianhyde (AT) speakeasy (DOT) net> wrote:
    >
    > > Here's the code, from RowsetDefinition.java:
    > >
    > > // DATA_TYPE DBType best guess is string
    > > int dbType = DBType.WSTR.userOrdinal;
    > > String datatype = (String)
    > > member.getPropertyValue(Property.DATATYPE.getName());
    > > if (datatype != null) {
    > > if (datatype.equals("Integer")) {
    > > dbType = DBType.I4.userOrdinal;
    > > } else if (datatype.equals("Numeric")) {
    > > dbType = DBType.R8.userOrdinal;
    > > } else {
    > > dbType = DBType.WSTR.userOrdinal;
    > > }
    > > }
    > > row.set(DataType.name, dbType);
    > > It suggests that you can override by setting the DATATYPE property of
    > > the calculated member to "Integer" or "Numeric".
    > >
    > > Julian
    > >
    > > ------------------------------
    > > *From:* mondrian-bounces (AT) pentaho (DOT) org [mailto:
    > > mondrian-bounces (AT) pentaho (DOT) org] *On Behalf Of *Matt Campbell
    > > *Sent:* Friday, March 23, 2007 11:56 AM
    > > *To:* mondrian (AT) pentaho (DOT) org
    > > *Subject:* [Mondrian] Datatype in MDSCHEMA_MEASURES
    > >
    > >
    > > Calculated members appear to always have a datatype of WSTR (130)
    > > specified in the XMLA response. This looks like a bug. Anyone have
    > > additional information?
    > >
    > > <row>
    > > <CATALOG_NAME>FoodMart</CATALOG_NAME>
    > > <CUBE_NAME>Sales</CUBE_NAME>
    > > <MEASURE_NAME>Profit Growth</MEASURE_NAME>
    > > <MEASURE_UNIQUE_NAME>[Measures].[Profit
    > > Growth]</MEASURE_UNIQUE_NAME>
    > > <MEASURE_CAPTION>Gewinn-Wachstum</MEASURE_CAPTION>
    > > <MEASURE_AGGREGATOR>127</MEASURE_AGGREGATOR>
    > > <DATA_TYPE>130</DATA_TYPE>
    > > <MEASURE_IS_VISIBLE>true</MEASURE_IS_VISIBLE>
    > > <DESCRIPTION>Sales Cube - Profit Growth Member</DESCRIPTION>
    > > </row>
    > >
    > >
    > > _______________________________________________
    > > 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
    Julian Hyde Guest

    Default RE: [Mondrian] Datatype in MDSCHEMA_MEASURES

    It was a case error on my part, the following worked fine:

    <CalculatedMemberProperty name="DATATYPE" value="Numeric" />

    I can add this detail to the Calculated Member section of the schema
    documentation if you think it's appropriate.


    Yes, please do, Matt! Every hint helps.

    Julian


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

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.