PDA

View Full Version : [Mondrian] Datatype in MDSCHEMA_MEASURES



Matt Campbell
03-23-2007, 03:02 PM
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

Julian Hyde
03-23-2007, 09:17 PM
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

Matt Campbell
03-26-2007, 05:22 PM
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

Matt Campbell
03-27-2007, 05:21 PM
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

Julian Hyde
03-27-2007, 09:00 PM
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