dbTalk Databases Forums  

Prevmember of parent

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


Discuss Prevmember of parent in the microsoft.public.sqlserver.olap forum.



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

Default Prevmember of parent - 10-19-2005 , 05:10 PM






I am trying to write a type of movement function that works with the timedim.
here is what i have.....
iif([TimeDim].CurrentMember.Count>0,
[%ACCOUNT%]-([%ACCOUNT%],[TimeDim].PrevMember),
[%ACCOUNT%]-([%ACCOUNT%],[TimeDim].Parent.PrevMember)
)

I am currently getting this error..
cannot convert member to Tuple - in a <dimension>.<property> function

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

Default Re: Prevmember of parent - 10-19-2005 , 06:11 PM






Assuming that there is a measure like Count (which isn't clear from the
limited info provided), then maybe:

Quote:
iif([Measures].[Count] > 0,
[%ACCOUNT%]-([%ACCOUNT%],[TimeDim].PrevMember),
[%ACCOUNT%]-([%ACCOUNT%],[TimeDim].Parent.PrevMember)
)
Quote:

- Deepak

Deepak Puri
Microsoft MVP - SQL Server

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


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

Default Re: Prevmember of parent - 10-19-2005 , 08:22 PM



As Deepak says it is not entirely clear what you are trying to do, if
you are trying to detect if the current time member has children then
the following might work.

Quote:
iif([Time].CurrentMember.Children.Count > 0,
[%ACCOUNT%]-([%ACCOUNT%],[TimeDim].PrevMember),
[%ACCOUNT%]-([%ACCOUNT%],[TimeDim].Parent.PrevMember)
)
Quote:
Although if that were the case I would suspect you are trying to check
whether you are at a specific level in which case the following is
probably a better way to go.

Quote:
iif([Time].CurrentMember.Level Is [Time].[Month],
[%ACCOUNT%]-([%ACCOUNT%],[TimeDim].PrevMember),
[%ACCOUNT%]-([%ACCOUNT%],Ancestor([TimeDim].CurrentMember, Month))
)
Quote:

Assuming that there is a measure like Count (which isn't clear from the
limited info provided), then maybe:


iif([Measures].[Count] > 0,
[%ACCOUNT%]-([%ACCOUNT%],[TimeDim].PrevMember),
[%ACCOUNT%]-([%ACCOUNT%],[TimeDim].Parent.PrevMember)
)



- Deepak

Deepak Puri
Microsoft MVP - SQL Server

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

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


Reply With Quote
  #4  
Old   
txksa
 
Posts: n/a

Default Re: Prevmember of parent - 10-21-2005 , 01:34 PM



Can't believe I overlooked Children!

"Darren Gosbell" wrote:

Quote:
As Deepak says it is not entirely clear what you are trying to do, if
you are trying to detect if the current time member has children then
the following might work.


iif([Time].CurrentMember.Children.Count > 0,
[%ACCOUNT%]-([%ACCOUNT%],[TimeDim].PrevMember),
[%ACCOUNT%]-([%ACCOUNT%],[TimeDim].Parent.PrevMember)
)


Although if that were the case I would suspect you are trying to check
whether you are at a specific level in which case the following is
probably a better way to go.


iif([Time].CurrentMember.Level Is [Time].[Month],
[%ACCOUNT%]-([%ACCOUNT%],[TimeDim].PrevMember),
[%ACCOUNT%]-([%ACCOUNT%],Ancestor([TimeDim].CurrentMember, Month))
)


Assuming that there is a measure like Count (which isn't clear from the
limited info provided), then maybe:


iif([Measures].[Count] > 0,
[%ACCOUNT%]-([%ACCOUNT%],[TimeDim].PrevMember),
[%ACCOUNT%]-([%ACCOUNT%],[TimeDim].Parent.PrevMember)
)



- Deepak

Deepak Puri
Microsoft MVP - SQL Server

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


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