[Mondrian] Aliases issue

Matt Campbell mcampbell at pentaho.com
Wed Oct 7 08:05:56 EDT 2015


Hi Yury,

That's not a bug.

The {} function requires a tuple set expression, but the Aggregate() function returns a numeric.  You can't embed Aggregate() as if it were a tuple expression.  Your second query defines a calculated member which has the value of that numeric expression.  As a member, it can be placed inside of a {}.

You might wonder why Mondrian can't convert the numeric expression to automatically be a tuple expression, since the two queries seem so similar.  Mondrian can't just guess which hierarchy the expression should be applied to, however, and that choice can have important consequences.  This behavior is consistent with other OLAP engines like Analysis Services.

-matt

From: mondrian-bounces at pentaho.org [mailto:mondrian-bounces at pentaho.org] On Behalf Of Yury Bakhmutski
Sent: Tuesday, October 06, 2015 10:58 AM
To: mondrian at pentaho.org
Subject: [Mondrian] FW: Aliases issue

Hi, All!

I'm investigating http://jira.pentaho.com/browse/MONDRIAN-472 and found out strange behavior:

select
 {([Measures].[Store Cost],[Store].[All Stores].[USA].[OR])} on AXIS(0),
{ AGGREGATE(TOPCOUNT({[Product].[Product Name].MEMBERS}, 10, [Measures].[Unit Sales]))} on AXIS(1)
from [Sales]

throws an exception: ... Caused by: mondrian.olap.MondrianException: Mondrian Error:No function matches signature '{<Numeric Expression>}'

while

with
MEMBER [Product].[10 Top Unit Sales] AS
'AGGREGATE(TOPCOUNT({[Product].[Product Name].MEMBERS}, 10, [Measures].[Unit Sales]))'
select
 {([Measures].[Store Cost],[Store].[All Stores].[USA].[OR])} on AXIS(0),
{[Product].[10 Top Unit Sales]} on AXIS(1)
from [Sales]

is executed successfully.

Is it a bug?

Thanks, Yury.

Best Regards,
Yury Bakhmutski
Software Engineer

EPAM Systems http://www.epam.com<http://www.epam.com/>; Minsk office, Belarus; GMT+3
Mobile phone:       +375 (29) 564-20-14 (MTC)
E-mail:               yury_bakhmutski at epam.com<mailto:yury_bakhmutski at epam.com>

CONFIDENTIALITY CAUTION AND DISCLAIMER
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.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.pentaho.org/pipermail/mondrian/attachments/20151007/9660ae3a/attachment-0001.html 


More information about the Mondrian mailing list