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. <br>
<br>Thanks<br><br>Luc<br><br><div class="gmail_quote">On Tue, Sep 25, 2012 at 10:29 AM, mehdi b <span dir="ltr"><<a href="mailto:mehdi_xinu@yahoo.com" target="_blank">mehdi_xinu@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div style="font-size:12pt;font-family:times new roman,new york,times,serif"><div>Hi</div><div><br></div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:times new roman,new york,times,serif">
I have a cube with calculated member called UsedCreditAvg which is defined in Measures dimenstion in the mondrian schema xml file as following</div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:times new roman,new york,times,serif">
<br></div><div style="font-size:16px;font-family:times new roman,new york,times,serif;font-style:normal;background-color:transparent"><span style="color:rgb(191,95,0)"> <Cube name="CardCredit" cache="false" enabled="true" defaultMeasure="UsedCredit"><br>
<Table schema="BIDWH"
name="SWT_CB_CRCARD_CREDIT"/><br><br> <DimensionUsage name="Branch" source="Branch" foreignKey="FD_BRANCH" /><br> <DimensionUsage name="Date" source="Date" foreignKey="FD_DATE" /><br>
<br> <Measure name="DistinctDate" column="FD_DATE" aggregator="distinct-count"></span></div><div style="font-size:16px;font-family:times new roman,new york,times,serif;font-style:normal;background-color:transparent;color:rgb(191,95,0)">
<span style="color:rgb(191,95,0)"> <CalculatedMemberProperty name="applyEndMarker" value="false"/><br></span></div><div style="font-size:16px;font-family:times new roman,new york,times,serif;font-style:normal;background-color:transparent;color:rgb(191,95,0)">
<span style="color:rgb(191,95,0)"> </Measure><br></span></div><div style="font-size:16px;font-family:times new roman,new york,times,serif;font-style:normal;background-color:transparent;color:rgb(191,95,0)"><span style="color:rgb(191,95,0)"><br>
</span></div><div style="font-size:16px;font-family:times new roman,new york,times,serif;font-style:normal;background-color:transparent;color:rgb(191,95,0)"><span style="color:rgb(191,95,0)"> <Measure name="UsedCredit" column="MR_USD_CREDIT" aggregator="sum" ><br>
</span></div><div style="font-size:16px;font-family:times new roman,new york,times,serif;font-style:normal;background-color:transparent;color:rgb(191,95,0)"><span style="color:rgb(191,95,0)"> <CalculatedMemberProperty name="applyEndMarker"
value="true"/><br></span></div><div style="font-size:16px;font-family:times new roman,new york,times,serif;font-style:normal;background-color:transparent;color:rgb(191,95,0)"><span style="color:rgb(191,95,0)"> </Measure><br>
</span></div><div style="font-size:16px;font-family:times new roman,new york,times,serif;font-style:normal;background-color:transparent;color:rgb(191,95,0)"><span style="color:rgb(191,95,0)"><br></span></div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:times new roman,new york,times,serif">
<span style="color:rgb(191,95,0)"> <CalculatedMember name="UsedCreditAvg" dimension="Measures"><br>
<Formula>[Measures].[UsedCredit]/[Measures].[DistinctDate]</Formula><br></span></div><div style="font-size:16px;font-family:times new roman,new york,times,serif;font-style:normal;background-color:transparent;color:rgb(191,95,0)">
<span style="color:rgb(191,95,0)"> <CalculatedMemberProperty name="applyEndMarker" value="false"/><br></span></div><span style="color:rgb(191,95,0)"></span><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:times new roman,new york,times,serif">
<span style="color:rgb(191,95,0)"> </CalculatedMember><br> </Cube></span><br></div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:times new roman,new york,times,serif">
<br></div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:times new roman,new york,times,serif">At first, I execute the following MDX:</div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:times new roman,new york,times,serif">
<br></div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:times new roman,new york,times,serif"><span style="color:rgb(0,0,191)">with <br>member [Date].[NewAll] as 'iif([Measures].CurrentMember.Properties("applyEndMarker")="false", [Date].[All], [Date].LastChild.LastChild)'<br>
select NON EMPTY {{[Date].[Month].Members}, [Date].[NewAll]} ON COLUMNS,<br> {[Measures].[UsedCredit], [Measures].[UsedCreditAvg]} ON ROWS<br>from [CardCredit]</span><br></div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:times new roman,new york,times,serif">
<br></div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:times new roman,new york,times,serif">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:</div>
<div style="font-style:normal;font-size:16px;background-color:transparent;font-family:times new roman,new york,times,serif"><br></div><div style="font-size:16px;font-family:times new roman,new york,times,serif;background-color:transparent;font-style:normal">
<span style="color:rgb(0,0,191)">with<br>member [Date].[Testtt] as '[Measures].CurrentMember.Name'<br>select [Date].[Testtt] on axis(0),<br>{[Measures].[UsedCredit], [Measures].[UsedCreditAvg]} ON axis(1)<br>from [CardCredit]<br>
</span></div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:times new roman,new york,times,serif"><br></div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:times new roman,new york,times,serif">
for [Measures].[UsedCredit], I got "UsedCredit" value, but for [Measures].[UsedCreditAvg] I got <span style="color:rgb(191,0,95)">"mondrian.olap.fun.MondrianEvaluationException: Expected value of type NUMERIC; got value 'UsedCredit' (STRING)"</span>.</div>
<div style="font-style:normal;font-size:16px;background-color:transparent;font-family:times new roman,new york,times,serif"><br></div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:times new roman,new york,times,serif">
It seems that the CurrentMemeber.Name or CurrentMemeber.Properties() dose not
work over calculated members.</div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:times new roman,new york,times,serif"><br></div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:times new roman,new york,times,serif">
So is there any solution? Is it a bug? what can I do to solve the problem?</div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:times new roman,new york,times,serif"><br></div><div style="font-style:normal;font-size:16px;background-color:transparent;font-family:times new roman,new york,times,serif">
<br></div></div></div><br>_______________________________________________<br>
Mondrian mailing list<br>
<a href="mailto:Mondrian@pentaho.org">Mondrian@pentaho.org</a><br>
<a href="http://lists.pentaho.org/mailman/listinfo/mondrian" target="_blank">http://lists.pentaho.org/mailman/listinfo/mondrian</a><br>
<br></blockquote></div><br>