[Mondrian] non empty cross join missing data

Adam Brusselback adambrusselback at gmail.com
Tue Apr 26 14:28:45 EDT 2016


So, sorry. I was a bit tired when I sent this last night. I should add a
bit more info so it's possible to look into.

Here is the mdx for the first picture:

WITH
SET [~COLUMNS] AS
    {[Time].[Fiscal].[Fiscal Year].Members}
SET [~ROWS] AS
    {[Direct-Indirect].[Direct-Indirect].[Direct-Indirect].Members}
SELECT
CrossJoin([~COLUMNS], {[Measures].[Net Sales]}) ON COLUMNS,
NON EMPTY [~ROWS] ON ROWS
FROM [Pinnacle - Sale]


mdx for the second picture:

WITH
SET [~COLUMNS] AS
    {[Time].[Fiscal].[Fiscal Year].Members}
SET [~ROWS] AS
    {[Direct-Indirect].[Direct-Indirect].[Direct-Indirect].Members}
SELECT
NON EMPTY CrossJoin([~COLUMNS], {[Measures].[Net Sales]}) ON COLUMNS,
NON EMPTY [~ROWS] ON ROWS
FROM [Pinnacle - Sale]


mdx for the third picture:

WITH
SET [~COLUMNS] AS
    {[Direct-Indirect].[Direct-Indirect].[Direct-Indirect].Members}
SET [~ROWS] AS
    {[Time].[Fiscal].[Fiscal Year].Members}
SELECT
NON EMPTY CrossJoin([~COLUMNS], {[Measures].[Net Sales]}) ON COLUMNS,
NON EMPTY [~ROWS] ON ROWS
FROM [Pinnacle - Sale]



I have been trying to debug this myself all today, and made a little
progress...

My issue lies in the RolapMemberBase equals overrride.

It doesn't take into account different keys for the same member.  So I have
a  [Time].[Fiscal].[2015] with a key of (1, 2015), and when it goes through
the RolapEvaluator.same method (called in setContext) it sees them as the
same thing and doesn't do a replace in the currentMember list when my next
member with a key of (2, 2015) comes in.

So I am not sure where the fix really needs to go for this, if it's in the
RolapMemberBase.equals method (don't know how far reaching that could be),
or in the RolapEvaluator.same method.  I could use some direction on this,
as I do need it fixed for my own use, but would much rather do it in a way
that could be submitted back to the project.

On Tue, Apr 26, 2016 at 3:33 AM, Adam Brusselback <adambrusselback at gmail.com
> wrote:

> Hey all, I seem to have found a bug in the non empty cross join
> optimization.
> Mondrian version: 4.3.0.1
>
> I have a data warehouse that is multi-tenant, and has a date dimension
> with different fiscal information per client (all tables segregated by a
> client_sk).  Each client has their own fiscal calendar, so it's necessary
> to separate them out like that.
>
> The issue seems to be, when  doing the cross join non empty with my fiscal
> year as a column, if the first result that comes back for that member is
> empty, even though it is for a totally different client, it will throw out
> that whole member.
>
> If the fiscal year is in the row, and another member in the column, the
> query returns as expected.
>
> I'll attach a few example query images:
> Example of why it seems to be removing the members (not first in the list):
> [image: Inline image 5]
>
> Here is my problem query:
> [image: Inline image 2]
>
> Here it is with the column/row flipped:
> [image: Inline image 4]
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.pentaho.org/pipermail/mondrian/attachments/20160426/f7003b68/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 23056 bytes
Desc: not available
Url : http://lists.pentaho.org/pipermail/mondrian/attachments/20160426/f7003b68/attachment-0003.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 41303 bytes
Desc: not available
Url : http://lists.pentaho.org/pipermail/mondrian/attachments/20160426/f7003b68/attachment-0004.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 28416 bytes
Desc: not available
Url : http://lists.pentaho.org/pipermail/mondrian/attachments/20160426/f7003b68/attachment-0005.png 


More information about the Mondrian mailing list