dbTalk Databases Forums  

Count of descendants

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


Discuss Count of descendants in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Truc H.
 
Posts: n/a

Default Count of descendants - 10-12-2005 , 02:04 PM






Hi all,
We are using SQL server 2000 Analysis services with Service pack 4.
Dimension : Geo
Level : country, province, area
We have a calculated member to count the number of Areas for each Geo member
(to be displayed as a row field)
*** Descendants([Geo].CurrentMember, [Geo].[Area]).Count
Since the Geo dimension need to be defined with “Non leaf members visible”,
we ends up with an extra Data member for each level.
How can the formula be modified to exclude those Data members from the
count ?
Thanks for your input.


Reply With Quote
  #2  
Old   
Darren Gosbell
 
Posts: n/a

Default Re: Count of descendants - 10-12-2005 , 06:29 PM







You can filter out data members with the following MDX

count(filter(descendants(Geo.Currentmember,,LEAVES ), NOT
Geo.currentmember IS Geo.currentmember.parent.DataMember ))'

--
Regards
Darren Gosbell [MCSD]
<dgosbell_at_yahoo_dot_com>
Blog: http://www.geekswithblogs.net/darrengosbell

Reply With Quote
  #3  
Old   
Truc H.
 
Posts: n/a

Default Re: Count of descendants - 10-13-2005 , 10:38 AM



It works perfectly !
Many thanks, Darren.

"Darren Gosbell" wrote:

Quote:
You can filter out data members with the following MDX

count(filter(descendants(Geo.Currentmember,,LEAVES ), NOT
Geo.currentmember IS Geo.currentmember.parent.DataMember ))'

--
Regards
Darren Gosbell [MCSD]
dgosbell_at_yahoo_dot_com
Blog: http://www.geekswithblogs.net/darrengosbell


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.