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

Julian Hyde jhyde at pentaho.com
Fri Jan 22 02:30:48 EST 2010


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,

 

http://jira.pentaho.com/browse/MONDRIAN-682

 

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

Example: 

WITH SET [XL_Row_Dim_0] AS 
'VisualTotals(Distinct(Hierarchize({ 
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,

Sergey

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.pentaho.org/pipermail/mondrian/attachments/20100121/43f40745/attachment.html 


More information about the Mondrian mailing list