dbTalk Databases Forums  

Find first leaf / January of time.currentmember

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


Discuss Find first leaf / January of time.currentmember in the microsoft.public.sqlserver.olap forum.



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

Default Find first leaf / January of time.currentmember - 10-17-2005 , 06:59 PM






I've been experimenting and searching posts for a week and haven't been
able to figure out how to create a calculated member to show the the
following:

I've been asked to determine the average market value for an account
for the year to date. The average should be determined by summing the
market value on the first day of the year with the market value of the
most recent month end and then dividing by 2. I'm able to get the
ending market value using:
(ClosingPeriod([time].[Month], [time].CurrentMember ),
[Measures].[Market Value])

What I can't figure out is how to get the market value for Janauary of
the current time member.

I'm sure I'm overlooking the obvious (but I'm fairly new to Analysis
Services and MDX so nothing's obvious). I think I want something like
this:

topcount(descendants(time.currentmember,,leaves),1 )

Any help is greatly appreciated.

Phil Steffek

FYI - My time dimension is set up with the levels years, quarters,
months, days. [Market Value] is one of my measures.


Reply With Quote
  #2  
Old   
Deepak Puri
 
Posts: n/a

Default Re: Find first leaf / January of time.currentmember - 10-17-2005 , 08:48 PM






How about something like:

(OpeningPeriod([Time].[Month],
Ancestor([Time].CurrentMember, [Time].[Year])),
[Measures].[Market Value])


- Deepak

Deepak Puri
Microsoft MVP - SQL Server

*** Sent via Developersdex http://www.developersdex.com ***

Reply With Quote
  #3  
Old   
Phil
 
Posts: n/a

Default Re: Find first leaf / January of time.currentmember - 10-18-2005 , 09:38 AM



Outstanding! Works exactly as desired. Thanks Deepak! Progressive
must be an interesting place to work if they can keep you on staff!


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.