[Mondrian] Datatype in MDSCHEMA_MEASURES

Matt Campbell mkambol at gmail.com
Tue Mar 27 17:17:58 EDT 2007


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.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.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.org [mailto:
> > mondrian-bounces at pentaho.org] *On Behalf Of *Matt Campbell
> > *Sent:* Friday, March 23, 2007 11:56 AM
> > *To:* mondrian at pentaho.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.org
> > http://lists.pentaho.org/mailman/listinfo/mondrian
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.pentaho.org/pipermail/mondrian/attachments/20070327/331ae7fe/attachment.html 


More information about the Mondrian mailing list