dbTalk Databases Forums  

TopCount with a Parent Child Dimension

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss TopCount with a Parent Child Dimension in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
wfaerber
 
Posts: n/a

Default TopCount with a Parent Child Dimension - 04-19-2004 , 09:39 AM






I am having the following problem. When I pass one of the two MDX
Query to Analysis Services Sp3 then I get the correct result (Ranking
of the top five products -this is a parent child dimension with about
100000 elements)

with
/*set T6 As 'TopCount(FILTER([Produkt].members,
ISLEAF([Produkt].Currentmember)),5,[Measures].[Anzahl])' */
set T6 As 'TopCount(Descendants([Produkt].[Alle Produkte und
Dienstleistungen],,LEAVES),5,[Measures].[Anzahl])'

select
{[Measures].[Anzahl]} on Columns,
{T6} on Rows
from Postensicht

However when I define a Named Set within Analysis Manager in a virtual
Cube I get the first five products in my Dimension. I just can not
figure out why because essentially the two approaches should give me
the same result.

thanks in advance cheers, Andrew

Reply With Quote
  #2  
Old   
Tom Chester
 
Posts: n/a

Default Re: TopCount with a Parent Child Dimension - 04-20-2004 , 12:07 PM






Named sets do not resolve in query context.

public @ the domain below
www.tomchester.net

"wfaerber" <wfaerber (AT) web (DOT) de> wrote

Quote:
I am having the following problem. When I pass one of the two MDX
Query to Analysis Services Sp3 then I get the correct result (Ranking
of the top five products -this is a parent child dimension with about
100000 elements)

with
/*set T6 As 'TopCount(FILTER([Produkt].members,
ISLEAF([Produkt].Currentmember)),5,[Measures].[Anzahl])' */
set T6 As 'TopCount(Descendants([Produkt].[Alle Produkte und
Dienstleistungen],,LEAVES),5,[Measures].[Anzahl])'

select
{[Measures].[Anzahl]} on Columns,
{T6} on Rows
from Postensicht

However when I define a Named Set within Analysis Manager in a virtual
Cube I get the first five products in my Dimension. I just can not
figure out why because essentially the two approaches should give me
the same result.

thanks in advance cheers, Andrew



Reply With Quote
  #3  
Old   
koehly47@web.de
 
Posts: n/a

Default Re: TopCount with a Parent Child Dimension - 04-21-2004 , 03:40 AM



Hey thanks for help. My question then is how can I do a ranking on only the leaf elements in a parent child dimension. In other words I want to know the top 5 products based on sales. A named set would be my ideal choice but if I can not filter out the products (leaf elements) then do a ranking on the leaves, then I do not have too many other choices. or is there another possible approach in which I am missing?

thanks a million! andrew

************************************************** ********************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...

Reply With Quote
  #4  
Old   
Tom Chester
 
Posts: n/a

Default Re: TopCount with a Parent Child Dimension - 04-21-2004 , 10:35 AM



Here's how to get just the leaf members:

Descendants(MyDim.DefaultMember,,LEAVES)

Use something like this as the 1st argument for TopCount.

public @ the domain below
www.tomchester.net

"andrew" <koehly47 (AT) web (DOT) de> wrote

Quote:
Hey thanks for help. My question then is how can I do a ranking on only
the leaf elements in a parent child dimension. In other words I want to know
the top 5 products based on sales. A named set would be my ideal choice but
if I can not filter out the products (leaf elements) then do a ranking on
the leaves, then I do not have too many other choices. or is there another
possible approach in which I am missing?
Quote:
thanks a million! andrew



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.