[Mondrian] MDX Conversion from Numeric to boolean
Julian Hyde
julianhyde at speakeasy.net
Mon Apr 23 18:06:25 EDT 2007
MDX probably behaves this way because it is modeled after Visual Basic,
which has no boolean type, and therefore simulates booleans using
integers. Sigh. I would much rather MDX had the semantics of SQL or
Java, where you need to explicitly convert, using '!= 0'.
But I don't write the MDX specification, so this is a bug. Please log
it.
Julian
_____
From: mondrian-bounces at pentaho.org [mailto:mondrian-bounces at pentaho.org]
On Behalf Of Anton Nikitin
Sent: Monday, April 23, 2007 10:48 AM
To: mondrian at pentaho.org
Subject: [Mondrian] MDX Conversion from Numeric to boolean
Hello.
I have found one little incompatibility between Mondrian and MSOLAP MDX.
Mondrian doesn't automatically convert integer values to Boolean if
necessary.
Example (Foodmart Sales) - let's display all Baked Goods which are
non-leaves:
select
{[Measures].[Unit Sales]} on columns,
Filter(Descendants([Product].[Food].[Baked Goods].[Bread]),
Count ([Product].currentMember.children)) on Rows
from [Sales]
This query works OK in MSAS 2000, but fails in Mondrian 2.3.2:
mondrian.olap.MondrianException: Mondrian Error:No function matches
signature 'Filter(<Set>, <Numeric Expression>)'
At the same time, if we modify it a bit, it starts to work in Mondrian:
select
{[Measures].[Unit Sales]} on columns,
Filter(Descendants([Product].[Food].[Baked Goods].[Bread]),
Count ([Product].currentMember.children)<>0) on Rows
from [Sales]
AFAIK the solution is rather cheap (changing FunUtil.canConvert() &
FunUtil.convert()).
I assume it is a bug.
Best regards,
Anton Nikitin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.pentaho.org/pipermail/mondrian/attachments/20070423/f29b544c/attachment.html
More information about the Mondrian
mailing list