[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mondrian
Subject:    Re: [Mondrian] Wrong result for TopCount using calculated measure
From:       Pedro Salgueiro <pedro.salgueiro () inductiva ! pt>
Date:       2012-12-26 15:15:28
Message-ID: CADV3r6jVR=pEZvLMhMHiHrYqdOgvoUy+4ose2wXCZmsKCAG31g () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


This could be related to this issue:

http://jira.pentaho.com/browse/MONDRIAN-1187?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel


Cheers,
Pedro


On Tue, Dec 25, 2012 at 5:12 AM, m.xinu <mehdi_xinu@yahoo.com> wrote:

> I checked it in Mondrian "3.3.0.14703", "3.4.1" and "3.5.0". The results
> all are the same.
> 
> 
> ------------------------------
> *From:* Kurtis Walker <kwalker@pentaho.com>
> *To:* mondrian@pentaho.org; m. xinu <mehdi_xinu@yahoo.com>
> *Sent:* Monday, December 24, 2012 4:37 PM
> *Subject:* Re: [Mondrian] Wrong result for TopCount using calculated
> measure
> 
> Seems like a bug to me. What version of mondrian are you using?
> 
> On Monday, December 24, 2012 10:24:32 AM m. xinu wrote:
> Hi,
> 
> I defined a calculated member in [Measures] dimension, and when I execute
> the following MDX:
> 
> select TopCount([ExpireDate].[Month].Members, 10,
> [Measures].[TotalAmount]) ON COLUMNS,
> [Measures].[TotalAmount] ON ROWS
> from [Deposit]
> 
> the result is wrong, but when I use Order() function instead of TopCount,
> the result is OK. In fact the following MDX works fine:
> 
> select Head(Order([ExpireDate].[Month].Members, [Measures].[TotalAmount],
> DESC), 10) ON COLUMNS,
> [Measures].[TotalAmount] ON ROWS
> from [Deposit]
> 
> The [Measures].[TotalAmount] is a calculated member defined in Mondrian
> schema as follows:
> 
> <CalculatedMember name="TotalAmount" dimension="Measures">
> <Formula>
> [Measures].[MainAccAmount] + [Measures].[IntblockedAccAmount] +
> [Measures].[BlockedAccAmount]
> </Formula>
> </CalculatedMember>
> 
> Is it a bug? or did I use something wrong?
> 
> 
> 
> 
> 
> 
> _______________________________________________
> Mondrian mailing list
> Mondrian@pentaho.org
> http://lists.pentaho.org/mailman/listinfo/mondrian
> 
> 


[Attachment #5 (text/html)]

This could be related to this issue:<br><br><a \
href="http://jira.pentaho.com/browse/MONDRIAN-1187?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel" \
target="_blank">http://jira.pentaho.com/browse/MONDRIAN-1187?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel</a><br>


<br>Cheers,<br>Pedro<div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, \
Dec 25, 2012 at 5:12 AM, m.xinu <span dir="ltr">&lt;<a \
href="mailto:mehdi_xinu@yahoo.com" \
target="_blank">mehdi_xinu@yahoo.com</a>&gt;</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:10pt;font-family:Courier \
New,courier,monaco,monospace,sans-serif">I checked it in Mondrian \
&quot;3.3.0.14703&quot;, &quot;3.4.1&quot; and &quot;3.5.0&quot;. The results all are \
the same.<div> <span><br></span></div><div class="hm HOEnZb"><div><br></div>  \
</div><div style="font-family:Courier \
New,courier,monaco,monospace,sans-serif;font-size:10pt"><div class="hm HOEnZb"> \
</div><div style="font-family:times new roman,new york,times,serif;font-size:12pt"> \
<div class="hm HOEnZb"> <div dir="ltr"> <font face="Arial"> <hr size="1">  <b><span \
style="font-weight:bold">From:</span></b> Kurtis Walker &lt;<a \
href="mailto:kwalker@pentaho.com" target="_blank">kwalker@pentaho.com</a>&gt;<br>  \
<b><span style="font-weight:bold">To:</span></b> <a \
href="mailto:mondrian@pentaho.org" target="_blank">mondrian@pentaho.org</a>; m. xinu \
&lt;<a href="mailto:mehdi_xinu@yahoo.com" \
target="_blank">mehdi_xinu@yahoo.com</a>&gt; <br>  <b><span \
style="font-weight:bold">Sent:</span></b> Monday, December 24, 2012 4:37 PM<br> \
<b><span style="font-weight:bold">Subject:</span></b> Re: [Mondrian] Wrong result for \
TopCount using calculated measure<br> </font> </div> </div><div><div class="h5"> <br>
<div>
<div>
<div style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">Seems \
like a bug to me.  What version of mondrian are you using?</div> <div \
style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"> \
</div> <div style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">On \
Monday, December 24, 2012 10:24:32 AM m. xinu wrote:<br></div> <div \
style="margin-right:40px;text-indent:0px;margin-left:40px;margin-bottom:0px;margin-top:12px"><span \
style="font-size:10pt;font-family:&#39;Courier \
New,courier,monaco,monospace,sans-serif&#39;">Hi,</span></div> <div \
style="margin-top:0px;margin-bottom:0px;margin-left:40px;margin-right:40px;text-indent:0px"><span \
style="font-size:10pt;font-family:&#39;Courier \
New,courier,monaco,monospace,sans-serif&#39;"><br></span></div> <div \
style="margin-top:0px;margin-bottom:0px;margin-left:40px;margin-right:40px;text-indent:0px;background-color:#000000"><span \
style="font-size:10pt;background-color:#000000;font-family:&#39;Courier \
New,courier,monaco,monospace,sans-serif&#39;">I defined a calculated member in \
[Measures] dimension, and when I execute the following MDX:</span></div>

<div style="margin-top:0px;margin-bottom:0px;margin-left:40px;margin-right:40px;text-indent:0px;background-color:#000000"><span \
style="font-size:10pt;font-family:&#39;Courier \
New,courier,monaco,monospace,sans-serif&#39;"><br> </span></div>
<div style="margin-top:0px;margin-bottom:0px;margin-left:40px;margin-right:40px;text-indent:0px;background-color:#000000"><span \
style="font-family:&#39;Courier \
New,courier,monaco,monospace,sans-serif&#39;;font-size:10pt;color:#800000">select \
TopCount([ExpireDate].[Month].Members, 10, [Measures].[TotalAmount]) ON COLUMNS,<br>  \
[Measures].[TotalAmount] ON ROWS<br>from [Deposit]</span></div> <div \
style="margin-top:0px;margin-bottom:0px;margin-left:40px;margin-right:40px;text-indent:0px;background-color:#000000"><span \
style="font-size:10pt;font-family:&#39;Courier \
New,courier,monaco,monospace,sans-serif&#39;"><br> </span></div>
<div style="margin-top:0px;margin-bottom:0px;margin-left:40px;margin-right:40px;text-indent:0px;background-color:#000000"><span \
style="font-size:10pt;background-color:#000000;font-family:&#39;Courier \
New,courier,monaco,monospace,sans-serif&#39;">the result is wrong, but when I use \
Order() function instead of TopCount, the result is OK. In fact the following MDX \
works fine:</span></div>

<div style="margin-top:0px;margin-bottom:0px;margin-left:40px;margin-right:40px;text-indent:0px;background-color:#000000"><span \
style="font-size:10pt;font-family:&#39;Courier \
New,courier,monaco,monospace,sans-serif&#39;"><br> </span></div>
<div style="margin-top:0px;margin-bottom:0px;margin-left:40px;margin-right:40px;text-indent:0px;background-color:#000000"><span \
style="font-family:&#39;Courier \
New,courier,monaco,monospace,sans-serif&#39;;font-size:10pt;color:#007f40">select \
Head(Order([ExpireDate].[Month].Members, [Measures].[TotalAmount], DESC), 10) ON \
COLUMNS,<br>  [Measures].[TotalAmount] ON ROWS<br>from [Deposit]</span></div>
<div style="margin-top:0px;margin-bottom:0px;margin-left:40px;margin-right:40px;text-indent:0px;background-color:#000000"><span \
style="font-size:10pt;font-family:&#39;Courier \
New,courier,monaco,monospace,sans-serif&#39;"><br> </span></div>
<div style="margin-top:0px;margin-bottom:0px;margin-left:40px;margin-right:40px;text-indent:0px;background-color:#000000"><span \
style="font-size:10pt;background-color:#000000;font-family:&#39;Courier \
New,courier,monaco,monospace,sans-serif&#39;">The [Measures].[TotalAmount] is a \
calculated member defined in Mondrian schema as follows:</span></div>

<div style="margin-top:0px;margin-bottom:0px;margin-left:40px;margin-right:40px;text-indent:0px;background-color:#000000"><span \
style="font-size:10pt;font-family:&#39;Courier \
New,courier,monaco,monospace,sans-serif&#39;"><br> </span></div>
<div style="margin-top:0px;margin-bottom:0px;margin-left:40px;margin-right:40px;text-indent:0px;background-color:#000000"><span \
style="font-family:&#39;Courier \
New,courier,monaco,monospace,sans-serif&#39;;font-size:10pt;color:#40007f">&lt;CalculatedMember \
name=&quot;TotalAmount&quot; dimension=&quot;Measures&quot;&gt;<br> \
&lt;Formula&gt;</span></div> <div \
style="margin-top:0px;margin-bottom:0px;margin-left:40px;margin-right:40px;text-indent:0px;background-color:#000000"><span \
style="font-family:&#39;Courier \
New,courier,monaco,monospace,sans-serif&#39;;font-size:10pt;color:#40007f">[Measures].[MainAccAmount] \
+ [Measures].[IntblockedAccAmount] + [Measures].[BlockedAccAmount]</span></div>

<div style="margin-top:0px;margin-bottom:0px;margin-left:40px;margin-right:40px;text-indent:0px;background-color:#000000"><span \
style="font-family:&#39;Courier \
New,courier,monaco,monospace,sans-serif&#39;;font-size:10pt;color:#40007f">&lt;/Formula&gt;<br>
 &lt;/CalculatedMember&gt;<br></span></div>
<div style="margin-top:0px;margin-bottom:0px;margin-left:40px;margin-right:40px;text-indent:0px;background-color:#000000"><span \
style="font-size:10pt;font-family:&#39;Courier \
New,courier,monaco,monospace,sans-serif&#39;"><br> </span></div>
<div style="margin-top:0px;margin-bottom:0px;margin-left:40px;margin-right:40px;text-indent:0px;background-color:#000000"><span \
style="font-size:10pt;background-color:#000000;font-family:&#39;Courier \
New,courier,monaco,monospace,sans-serif&#39;">Is it a bug? or did I use something \
wrong?</span></div>

<div style="margin-top:0px;margin-bottom:0px;margin-left:40px;margin-right:40px;text-indent:0px;background-color:#000000"><span \
style="font-size:10pt;font-family:&#39;Courier \
New,courier,monaco,monospace,sans-serif&#39;"><br> </span></div>
<div style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><br><br></div></div></div><br><br> \
</div></div></div> </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></div>



_______________________________________________
Mondrian mailing list
Mondrian@pentaho.org
http://lists.pentaho.org/mailman/listinfo/mondrian


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic