dbTalk Databases Forums  

MDX parallelperiod question

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


Discuss MDX parallelperiod question in the microsoft.public.sqlserver.olap forum.



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

Default MDX parallelperiod question - 04-19-2005 , 06:41 AM






Hi everybody.
I would like to know if it is possible to have an MDX calculated cell in
which
would be shown the value of the "previous period" measure.

I tried somethnig like this:
ParallelPeriod([Time].CurrentMember.Level.Name , 1 , [Measure].[Value])

but it does not work.

It works only if I write [Time].[yyyy] (for example) instead of
currentmember stuff.

But i would like to have a new measure that changes the value along with the
selected period of time.

I hope I was able to expose my problem...

Tia.



Ciao.












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

Default Re: MDX parallelperiod question - 04-19-2005 , 12:05 PM






There appear to be some issues with how you're using ParallelPeriod().
Here's the SQL Server BOL info:

Quote:
ParallelPeriod
Returns a member from a prior period in the same relative position as a
specified member.

Syntax
ParallelPeriod([«Level»[, «Numeric Expression»[, «Member»]]])

Remarks
This function is similar to the Cousin function, but is more closely
related to time series. It takes the ancestor of «Member» at «Level»
(call it ancestor); then it takes the sibling of ancestor that lags by
«Numeric Expression», and returns the parallel period of «Member» among
the descendants of that sibling.

This function has the following defaults:

Default «Member» value is Time.CurrentMember if «Level» is not
specified. Otherwise it is dimension.CurrentMember, where dimension is
the dimension to which level belongs.

Default «Numeric Expression» is 1.

Default «Level» is the level of the parent of «Member».
This function is equivalent to
Cousin(Member,Lag(Ancestor(Member,Level),Numeric Expression).
Quote:
So the 1st (optional) argument is a level, not a name. The 3rd
(optional) argument should be in same hierarchy.


Not sure of your exact requirement, maybe like this:

Quote:
(ParallelPeriod(), [[Measure].[Value])


- Deepak

Deepak Puri
Microsoft MVP - SQL Server

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


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

Default Re: MDX parallelperiod question - 04-20-2005 , 08:46 AM



Dear Deepak,
thanks for your kind answer.
It was useful to reflect a bit more on the SQL Server BOL info even if I
read it befor writing my message.
In any case I tried your suggestion:

Quote:
(ParallelPeriod(), [[Measure].[Value])
but it does not seem to be accepted as a calculated member...

thanks and bye.





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

Default Re: MDX parallelperiod question - 04-20-2005 , 10:31 AM



How about if you explicitly specify the level:

Quote:
(ParallelPeriod([Time].CurrentMember.Parent.Level),
[[Measure].[Value])
Quote:

- Deepak

Deepak Puri
Microsoft MVP - SQL Server

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


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.