<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:56.7pt 42.5pt 56.7pt 85.05pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F497D">Hi Yury,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">That&#8217;s not a bug.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">The {} function requires a tuple set expression, but the Aggregate() function returns a numeric.&nbsp; You can&#8217;t embed Aggregate() as if it were a tuple expression.&nbsp; Your second query defines a calculated member which
 has the value of that numeric expression.&nbsp; As a member, it can be placed inside of a {}.&nbsp;
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">You might wonder why Mondrian can&#8217;t convert the numeric expression to automatically be a tuple expression, since the two queries seem so similar.&nbsp; Mondrian can&#8217;t just guess which hierarchy the expression should
 be applied to, however, and that choice can have important consequences.&nbsp; This behavior is consistent with other OLAP engines like Analysis Services.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">-matt<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> mondrian-bounces@pentaho.org [mailto:mondrian-bounces@pentaho.org]
<b>On Behalf Of </b>Yury Bakhmutski<br>
<b>Sent:</b> Tuesday, October 06, 2015 10:58 AM<br>
<b>To:</b> mondrian@pentaho.org<br>
<b>Subject:</b> [Mondrian] FW: Aliases issue<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">Hi, <span style="color:#1F497D">All</span>!<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">I&#8217;m investigating <a href="http://jira.pentaho.com/browse/MONDRIAN-472">
http://jira.pentaho.com/browse/MONDRIAN-472</a> and found out strange behavior: <o:p>
</o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">select <o:p></o:p></p>
<p class="MsoNormal">&nbsp;{([Measures].[Store Cost],[Store].[All Stores].[USA].[OR])} on AXIS(0),<o:p></o:p></p>
<p class="MsoNormal">{ AGGREGATE(TOPCOUNT({[Product].[Product Name].MEMBERS}, 10, [Measures].[Unit Sales]))} on AXIS(1)<o:p></o:p></p>
<p class="MsoNormal">from [Sales]<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">throws an exception: &#8230; Caused&nbsp;by:&nbsp;mondrian.olap.MondrianException:&nbsp;Mondrian&nbsp;Error:No&nbsp;function&nbsp;matches&nbsp;signature&nbsp;'{&lt;Numeric&nbsp;Expression&gt;}' &nbsp;<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">while <o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">with<o:p></o:p></p>
<p class="MsoNormal">MEMBER [Product].[10 Top Unit Sales] AS <o:p></o:p></p>
<p class="MsoNormal">'AGGREGATE(TOPCOUNT({[Product].[Product Name].MEMBERS}, 10, [Measures].[Unit Sales]))'<o:p></o:p></p>
<p class="MsoNormal">select <o:p></o:p></p>
<p class="MsoNormal">&nbsp;{([Measures].[Store Cost],[Store].[All Stores].[USA].[OR])} on AXIS(0),<o:p></o:p></p>
<p class="MsoNormal">{[Product].[10 Top Unit Sales]} on AXIS(1)<o:p></o:p></p>
<p class="MsoNormal">from [Sales]<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">is executed successfully.<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">Is it a bug?<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">Thanks, Yury.<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:7.5pt;font-family:&quot;Verdana&quot;,sans-serif;color:gray;mso-fareast-language:RU">Best Regards,<br>
</span><b><span style="font-size:7.5pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:RU">Yury Bakhmutski</span></b><span style="color:#1F497D;mso-fareast-language:RU"><br>
</span><span style="font-size:7.5pt;font-family:&quot;Verdana&quot;,sans-serif;color:gray;mso-fareast-language:RU">Software Engineer<br>
<br>
EPAM Systems </span><a href="http://www.epam.com/"><span style="font-size:7.5pt;font-family:&quot;Verdana&quot;,sans-serif;mso-fareast-language:RU">http://www.epam.com</span></a><span style="font-size:7.5pt;font-family:&quot;Verdana&quot;,sans-serif;color:gray;mso-fareast-language:RU">;
 Minsk office, Belarus; GMT&#43;3<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:7.5pt;font-family:&quot;Verdana&quot;,sans-serif;color:gray;mso-fareast-language:RU">Mobile phone:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#43;375 (29) 564-20-14 (MTC)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:7.5pt;font-family:&quot;Verdana&quot;,sans-serif;color:gray;mso-fareast-language:RU">E-mail:</span><span style="font-size:7.5pt;font-family:&quot;Verdana&quot;,sans-serif;color:#1F497D;mso-fareast-language:RU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-size:7.5pt;font-family:&quot;Verdana&quot;,sans-serif;mso-fareast-language:RU"><a href="mailto:yury_bakhmutski@epam.com">yury_bakhmutski@epam.com</a></span><span style="color:#1F497D;mso-fareast-language:RU">&nbsp;&nbsp;<br>
<br>
</span><span style="font-size:7.5pt;font-family:&quot;Verdana&quot;,sans-serif;color:silver;mso-fareast-language:RU">CONFIDENTIALITY CAUTION AND DISCLAIMER<br>
This message is intended only for the use of the individual(s) or entity(ies) to which it is addressed and contains information that is legally privileged and confidential. If you are not the intended recipient, or the person responsible for delivering the
 message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. All unintended recipients are obliged to delete this message and destroy any printed copies.</span><o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
</body>
</html>