[Mondrian] Bug in getNamedSet(List<Id.Segment> nameParts) ?

Julian Hyde jhyde at pentaho.com
Wed Feb 18 14:49:58 EST 2009


For the record, here are the principles that apply here:

1. The Children function operates on members. When you apply it to a
dimension or hierarchy, CurrentMember is inserted implicitly. So,
[Product].Children is equivalent to [Product].CurrentMember.Children.
Similarly, Descendants applied to a dimension or hierarchy implicitly adds a
call to CurrentMember.

2. Sets are evaluated in the context of the slicer. If it helps, imagine
that they are evaluated once, at the start of the query, before any axes are
evaluated.

3. When evaluating a calculated member, the context of that member's
dimension is reset to the previous context. For example,

WITH MEMBER [Measures].[Foo] AS ' [Measures].CurrentMember.Name '
SELECT [Measures].[Foo] ON 0
FROM Sales
WHERE [Measures].[Store Sales]

will print 'Store Sales'. Analysis Services 2000 retained the context as Foo
while evaluating Foo, and that always struck me as wrong, so I adopted a
different behavior in mondrian. I think AS2005 and later adopted my
behavior. :)

Is the behavior you are seeing consistent with that?

Julian

> -----Original Message-----
> From: mondrian-bounces at pentaho.org 
> [mailto:mondrian-bounces at pentaho.org] On Behalf Of Pedro Alves
> Sent: Wednesday, February 18, 2009 9:19 AM
> To: Mondrian Mailing List
> Subject: [Mondrian] Bug in getNamedSet(List<Id.Segment> nameParts) ?
> 
> 
> 
> 
> Hello everyone
> 
> 
> 
> I'm having a problem with a query. This returns no results: 
> 
> with set a as '[Product].Children'
>   member [Product].[Filter] as 'Aggregate([a])'
> select {[Measures].[Unit Sales]} ON COLUMNS,
>   {[Promotion Media]} ON ROWS
> from [Sales]
> where [Product].[Filter]
> 
> 
> and this works as expected (only difference being 
> [Product].[All Products]):
> 
> 
> with set a as '[Product].[All Products].Children'
>   member [Product].[Filter] as 'Aggregate([a])'
> select {[Measures].[Unit Sales]} ON COLUMNS,
>   {[Promotion Media]} ON ROWS
> from [Sales]
> where [Product].[Filter]
> 
> 
> If instead of .Children I use Descendants, It's the same behaviour
> 
> 
> I know [Product] is a RolapDimension, while [Product].[All 
> Products] is a
> RolapMember; 
> 
> But I don't know why there should be a difference in this 
> syntaxes, since the
> following queries work:
> 
> 
> with set a as '[Product].Children'
>   member [Product].[Filter] as 'Aggregate([a])'
> select {[Measures].[Unit Sales]} ON COLUMNS,
>   {[Product].[Filter]} ON ROWS
> from [Sales]
> 
> with set a as '[Product].[All Products].Children'
>   member [Product].[Filter] as 'Aggregate([a])'
> select {[Measures].[Unit Sales]} ON COLUMNS,
>   {[Product].[Filter]} ON ROWS
> from [Sales]
> 
> 
> Is this a bug or a expected issue? I'm using this in CDF and 
> I'l like to make some
> automatic exclusions, and got into this.
> 
> 
> Thanks
> 
> 
> 
> -- 
> Pedro Alves
> pmgalves-at-gmail.com
> 
> _______________________________________________
> Mondrian mailing list
> Mondrian at pentaho.org
> http://lists.pentaho.org/mailman/listinfo/mondrian
> 





More information about the Mondrian mailing list