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

Pedro Alves pedro at neraka.no-ip.org
Thu Feb 19 04:56:13 EST 2009



I think #1 is the issue; Since my set is aggregated and used in the where
clause, there seems to be no slicer there. It's exactly the same if I use
[Products].CurrentMember.


I "solved" my problem by using defaultMember when I have only the
dimension. But still, it's a very tricky situation.


Thanks



On Wed, Feb 18, 2009 at 11:49:58AM -0800, Julian Hyde wrote:
> 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
> > 
> 
> 
> _______________________________________________
> Mondrian mailing list
> Mondrian at pentaho.org
> http://lists.pentaho.org/mailman/listinfo/mondrian

-- 
Pedro Alves
pmgalves-at-gmail.com




More information about the Mondrian mailing list