[Mondrian] RE: VisualTotals + Distinct-count measure gives wrong results

Sergey Mazin sergey.mazin at skype.net
Wed Mar 10 07:17:59 EST 2010

Hi Julian,


Could you please check that fix:






From: Julian Hyde [mailto:jhyde at pentaho.com] 
Sent: Friday, January 22, 2010 9:31 AM
To: 'Sergey Mazin'; 'Mondrian developer mailing list'
Subject: RE: VisualTotals + Distinct-count measure gives wrong results


I'd put a breakpoint in the expression inside the visual totals function. It
should be aggregate( < set of members >).


Distinct-count measures are very difficult to aggregate. You have to go back
to the underlying database. We aggregate distinct-count measures correctly
in other places (e.g. if you create a compound slicer) but it's tricky.



From: Sergey Mazin [mailto:sergey.mazin at skype.net] 
Sent: Thursday, January 21, 2010 8:17 AM
To: 'Mondrian developer mailing list'
Cc: jhyde at pentaho.com
Subject: VisualTotals + Distinct-count measure gives wrong results

Hi Julian,




[Measures].[Number of Employees] - is distinct count measure. 


WITH SET [XL_Row_Dim_0] AS 
Ascendants([Store].[All Stores].[USA].[OR]), 
Descendants([Store].[All Stores].[USA].[OR]), 
Ascendants([Store].[All Stores].[USA].[CA]), 
Descendants([Store].[All Stores].[USA].[CA])})))' 
SELECT NON EMPTY Hierarchize(Intersect({DrilldownLevel({ 
[Store].[All Stores] 
})}, [XL_Row_Dim_0])) ON COLUMNS 
FROM [HR] WHERE ([Measures].[Number of Employees]) 

Query should return: 

Axis #0: 
{[Measures].[Number of Employees]} 
Axis #1: 
{[Store].[All Stores]} 
{[Store].[All Stores].[USA]} 
Row #0: 329 
Row #0: 329 

But returns empty set. 

The same query with NOT distinct measure works.


In distinct query cells are not being evaluated properly and no queries is
sent to database.

Could you please advise what is the best place to start investigating.


Best regards,


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.pentaho.org/pipermail/mondrian/attachments/20100310/3e575152/attachment.html 

More information about the Mondrian mailing list