[Mondrian] Exists()

Matt Campbell mcampbell at pentaho.com
Fri May 17 11:47:12 EDT 2013


According to the docs, Exists() "returns the set of tuples of the first set specified that exist with one or more tuples of the second set specified."  So,

Exists([Customers].[Name].members,
 [Customers].[All Customers].[USA].[OR])

will return the set of Customers in [OR].

I'm looking at a case right now in which the dimension from the set in the first argument is not explicitly included in the second argument (MONDRIAN-1254):

Exists([Customers].[Name].members,
 [Product].[All Products].[Drink])

The person who submitted the case believes this should return some customers, but it currently returns an empty set.  He may be incorrectly expecting the function to take fact data into account and just include customers who have [Drink] data.  Only if the 3rd parameter (Measure Group) is specified will the function limit based on fact data, and the measure group param is currently unsupported in Mondrian (although may be added-see MONDRIAN-1277).

Regardless, I think there is a question of correctness.  With Analysis Services, the set of tuples in the first and second argument implicitly include the default members of all other dimensions.  So with the example above, Analysis Services will return all customers since [Product].[All Products] is implicitly in the first argument, and [All Products] exists within the tuples of the second set.  Mondrian currently returns no customers, but if you explicitly add the [All Products] to the first argument it will return all customers:

Exists([Customers].[Name].members * Product.[All Products],
  [Product].[All Products].[Drink])

So what should Mondrian's behavior?  Should Mondrian continue to only factor in the explicitly included members in the tuple, or should it include the implicit default members of all other dimensions?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.pentaho.org/pipermail/mondrian/attachments/20130517/13bb06f1/attachment-0001.html 


More information about the Mondrian mailing list