<div dir="ltr">Hello,<br>I'm sorry to bother you guys with this, but it seemed to me appropriate to write this one to the mailing list, just to be sure it's not a mondrian bug.<br><br>I have this mondrian xml definition with a fact table (as a sql query) and a hierarchical dimension.<br>
Using the cube with a Integer/Double fact column, is fine, but if I use a VarChar column, i get an exception, but only when I expand the hierarchical dimension root level. I am able to combine the fact (the VarChar one) with the dimension, and see one line with the hierarchy all name and the max value from the Varchar db column.<br>
<br>Is this a bug or do i have something wrong with my xml definition ?<br><br>If necessary i could try and build an example on top o foodmart example.<br>I'm using mondrian ver. 2.4.0.9716.<br><br>Here is the mondrian xml definition :<br>
<br><?xml version="1.0" encoding="ISO-8859-1"?><br><br><Schema name="5_1219928473000"><br> <Cube name="5" caption="Cubo Teste" cache="true" enabled="true"><br>
<View alias="PRODUTO"><br> <SQL><![CDATA[<br>SELECT<br> THIS_.CHVP AS PCHVP,<br> THIS_.DESIGPRODUTO AS PDESIGPRODUTO<br> A8676_.CHVEESTRUTURACLD AS CHVEESTRUTURACLD<br> FROM PRODUTO THIS_<br>
INNER JOIN ESTRUTURA A8676_ ON A8676_.CHVP = THIS_.CHVP<br>]]></SQL><br> </View><br> <Dimension name="Produtos" foreignKey="PCHVP"><br> <Hierarchy name="Total Produtos" allMemberName="Total Produtos" hasAll="true" primaryKey="CHVP" primaryKeyTable="PRODUTO"><br>
<Table name="PRODUTO" alias="PRODUTO22"/><br> <Level name="Referência" table="PRODUTO22" column="REFPRODUTO" uniqueMembers="true"><br>
<Property column="CHVP" name="ChvP"/><br> <Property column="DESIGPRODUTO" name="Designação"/><br> </Level><br> </Hierarchy><br>
</Dimension><br> <Dimension name="Classificação" foreignKey="CHVEESTRUTURACLD"><br> <Hierarchy name="Total Classificação" allMemberName="Total Classificação" hasAll="true" primaryKey="CHVP" primaryKeyTable="ESTRUTURA"><br>
<Table name="ESTRUTURA" alias="ESTRUTURA18"><br> <SQL><![CDATA["ESTRUTURA18".CHVECATEGORIA IN (select this_.ChvP as y0_ from Categoria this_ where (((this_.ChvEExercicio=[$EXER] or this_.ChvEExercicio is null) and (this_.ChvEUnidadeUtilizadora is null or this_.ChvEUnidadeUtilizadora=[$UU])) and (lower(this_.SiglaCategoria) like 'cld' and this_.SiglaCategoria is not null))) ]]></SQL><br>
</Table><br> <Level name="CCA" table="ESTRUTURA18" column="CHVP" parentColumn="CHVEESTRUTURA" ordinalColumn="CODCOMPIESTRUTURA" nameColumn="CODCOMPESTRUTURA" nullParentValue="NULL" uniqueMembers="true"><br>
<Property column="DESIGESTRUTURA" name="Designação"/><br> </Level><br> </Hierarchy><br> </Dimension><br> <Measure column="PCHVP" name="ChvP" aggregator="sum" formatString="###,##0"/><br>
<Measure column="PDESIGPRODUTO" name="DesigProduto" datatype="String" aggregator="max" formatString="###,##0"/><br> </Cube><br></Schema><br><br><br>
When i issue this query :<br>select {[Measures].[DesigProduto]} ON COLUMNS,<br>Hierarchize(Union({[Classificação.Total Classificação].[Total
Classificação]}, [Classificação.Total Classificação].[Total
Classificação].Children)) ON ROWS<br>from [5]<br><br>I obtain this exception :<br>"<br>Cause:<br>class com.tonbeller.jpivot.olap.model.OlapException:mondrian.olap.MondrianException: Mondrian Error:Internal error: Error while executing query [select {[Measures].[DesigProduto]} ON COLUMNS, Hierarchize(Union({[Classificação.Total Classificação].[Total Classificação]}, [Classificação.Total Classificação].[Total Classificação].Children)) ON ROWS from [5] ]<br>
<br>com.tonbeller.jpivot.mondrian.MondrianModel.getResult(MondrianModel.java:305)<br>com.tonbeller.jpivot.mondrian.MondrianModel.getCurrentMdx(MondrianModel.java:856)<br>pt.gedi.bi.services.rep.ad.Explorador_ServiceImpl.handleMondrianResult(Explorador_ServiceImpl.java:598)<br>
pt.gedi.bi.services.rep.ad.Explorador_ServiceImpl.getMondrianResult(Explorador_ServiceImpl.java:314)<br>pt.gedi.bi.control.actions.rep.ad.ExploradorCuboExtendedAction.getArealistHeaderConfig(ExploradorCuboExtendedAction.java:1456)<br>
sun.reflect.GeneratedMethodAccessor624.invoke(Unknown Source)<br>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br>java.lang.reflect.Method.invoke(Method.java:597)<br>pt.gedi.base.control.actions.BaseAction.processAskServer(BaseAction.java:2175)<br>
pt.gedi.base.control.actions.BaseAction.execute(BaseAction.java:1641)<br>...<br>Cause:<br>class mondrian.olap.MondrianException:Mondrian Error:Internal error: Error while executing query [select {[Measures].[DesigProduto]} ON COLUMNS, Hierarchize(Union({[Classificação.Total Classificação].[Total Classificação]}, [Classificação.Total Classificação].[Total Classificação].Children)) ON ROWS from [5] ]<br>
<br>mondrian.resource.MondrianResource$_Def0.ex(MondrianResource.java:755)<br>mondrian.olap.Util.newInternal(Util.java:1104)<br>mondrian.olap.Util.newError(Util.java:1120)<br>mondrian.rolap.RolapConnection.execute(RolapConnection.java:442)<br>
com.tonbeller.jpivot.mondrian.MondrianModel.getResult(MondrianModel.java:279)<br>com.tonbeller.jpivot.mondrian.MondrianModel.getCurrentMdx(MondrianModel.java:856)<br>pt.gedi.bi.services.rep.ad.Explorador_ServiceImpl.handleMondrianResult(Explorador_ServiceImpl.java:598)<br>
pt.gedi.bi.services.rep.ad.Explorador_ServiceImpl.getMondrianResult(Explorador_ServiceImpl.java:314)<br>pt.gedi.bi.control.actions.rep.ad.ExploradorCuboExtendedAction.getArealistHeaderConfig(ExploradorCuboExtendedAction.java:1456)<br>
sun.reflect.GeneratedMethodAccessor624.invoke(Unknown Source)<br>...<br>Cause:<br>class java.lang.ClassCastException:java.lang.String cannot be cast to java.lang.Double<br><br>mondrian.olap.fun.FunUtil.max(FunUtil.java:945)<br>
mondrian.rolap.RolapAggregator$4.aggregate(RolapAggregator.java:58)<br>mondrian.olap.fun.BuiltinFunTable$22$1.aggregateChildren(BuiltinFunTable.java:655)<br>mondrian.olap.fun.BuiltinFunTable$22$1$1.evaluate(BuiltinFunTable.java:630)<br>
mondrian.rolap.RolapEvaluator.evaluateCurrent(RolapEvaluator.java:494)<br>mondrian.calc.impl.ValueCalc.evaluate(ValueCalc.java:31)<br>mondrian.olap.fun.FunUtil.evaluateSet(FunUtil.java:1223)<br>mondrian.olap.fun.FunUtil.max(FunUtil.java:937)<br>
mondrian.rolap.RolapAggregator$4.aggregate(RolapAggregator.java:58)<br>mondrian.olap.fun.BuiltinFunTable$22$1.aggregateChildren(BuiltinFunTable.java:655)<br>...<br>"<br clear="all"><br>Thank you in advance.<br><br>Best wishes,<br>
<br>-- <br>Eduardo Andrade<br><a href="mailto:eduardofandrade@gmail.com">eduardofandrade@gmail.com</a><br>
</div>