[Mondrian] MondrianEvaluationException when calling CurrentMember.Name over a calculated member

Luc Boudreau lucboudreau at gmail.com
Mon Oct 22 12:51:56 EDT 2012


AFAIK, we do not support arbitrary properties over calculated members. That
being said, .Name and .Properties should return the correct name and an
empty property collection (or at least the name property I guess). There
are other properties which should probably be supported as well, like the
ordering. Please create a jira case to track this and add the full stack
trace that you have obtained.

Thanks

Luc

On Tue, Sep 25, 2012 at 10:29 AM, mehdi b <mehdi_xinu at yahoo.com> wrote:

> Hi
>
> I have a cube with calculated member called UsedCreditAvg which is defined
> in Measures dimenstion in the mondrian schema xml file as following
>
>     <Cube name="CardCredit" cache="false" enabled="true"
> defaultMeasure="UsedCredit">
>         <Table schema="BIDWH" name="SWT_CB_CRCARD_CREDIT"/>
>
>         <DimensionUsage name="Branch" source="Branch"
> foreignKey="FD_BRANCH" />
>         <DimensionUsage name="Date" source="Date" foreignKey="FD_DATE" />
>
>         <Measure name="DistinctDate" column="FD_DATE"
> aggregator="distinct-count">
>              <CalculatedMemberProperty name="applyEndMarker"
> value="false"/>
>         </Measure>
>
>         <Measure name="UsedCredit" column="MR_USD_CREDIT" aggregator="sum"
> >
>              <CalculatedMemberProperty name="applyEndMarker" value="true"/>
>         </Measure>
>
>         <CalculatedMember name="UsedCreditAvg" dimension="Measures">
>
> <Formula>[Measures].[UsedCredit]/[Measures].[DistinctDate]</Formula>
>              <CalculatedMemberProperty name="applyEndMarker"
> value="false"/>
>         </CalculatedMember>
>     </Cube>
>
> At first, I execute the following MDX:
>
> with
> member [Date].[NewAll] as
> 'iif([Measures].CurrentMember.Properties("applyEndMarker")="false",
> [Date].[All], [Date].LastChild.LastChild)'
> select NON EMPTY {{[Date].[Month].Members}, [Date].[NewAll]} ON COLUMNS,
>   {[Measures].[UsedCredit], [Measures].[UsedCreditAvg]} ON ROWS
> from [CardCredit]
>
> and I got wrong result for [Measures].[UsedCreditAvg]. Then I tried some
> other MDX queries, and I finally found that when I execute the following
> MDX:
>
> with
> member [Date].[Testtt] as '[Measures].CurrentMember.Name'
> select [Date].[Testtt] on axis(0),
> {[Measures].[UsedCredit], [Measures].[UsedCreditAvg]} ON axis(1)
> from [CardCredit]
>
> for [Measures].[UsedCredit], I got "UsedCredit" value, but for
> [Measures].[UsedCreditAvg] I got "mondrian.olap.fun.MondrianEvaluationException:
> Expected value of type NUMERIC; got value 'UsedCredit' (STRING)".
>
> It seems that the CurrentMemeber.Name or CurrentMemeber.Properties() dose
> not work over calculated members.
>
> So is there any solution? Is it a bug? what can I do to solve the problem?
>
>
>
> _______________________________________________
> 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/20121022/c70dfb49/attachment.html 


More information about the Mondrian mailing list