dbTalk Databases Forums  

Access the Name of a member at a specific level?

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


Discuss Access the Name of a member at a specific level? in the microsoft.public.sqlserver.olap forum.



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

Default Access the Name of a member at a specific level? - 10-05-2005 , 03:41 AM






I need a calc-member that returns the name of the "top" member.
The MDX below gives me the member, but MyHierarchy has 5 levels and I want
only the name of the member at the leaf level. I tried appending
".Item(0).Name", but that gives an error.

TopCount(Descendants([MyHierarchy].CurrentMember, Level0), 1,
[Measures].[aNumber])

Thanks,
Les McPhee

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

Default Re: Access the Name of a member at a specific level? - 10-05-2005 , 06:18 AM






Quote:
I tried appending ".Item(0).Name", but that gives an error.
You are close, technically TopCount is returning a set of tuples and
what you want is the first member within the first tuple.

TopCount(Descendants([MyHierarchy].CurrentMember, Level0), 1,
[Measures].[aNumber]).item(0).item(0).Name

Should do the trick!

--
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.