dbTalk Databases Forums  

AS 2005 MDX ParallelPeriod used in calculated member

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


Discuss AS 2005 MDX ParallelPeriod used in calculated member in the microsoft.public.sqlserver.olap forum.



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

Default AS 2005 MDX ParallelPeriod used in calculated member - 12-29-2005 , 08:56 AM






Hello all,

I want to create a calculated member to get inventory of a specified
period, such as 1 month ago, 1 quarter ago, 1 year ago. I use AS2005
and have a date dimension with Date hierarchy as follows

Date
Year
Quarter
Month
Day

Assume the current date memeber is Decemeber 25, 2005

1. ParallelPeriod( [Date].[Date].[Year], 1,
ClosingPeriod([Date].[Date].[Day], [Date].[Date].[CurrentMember])
2. ParallelPeriod( [Date].[Date].[Quarter], 1,
ClosingPeriod([Date].[Date].[Day], [Date].[Date].[CurrentMember])
3. ParallelPeriod( [Date].[Date].[Month], 1,
ClosingPeriod([Date].[Date].[Day], [Date].[Date].[CurrentMember])

The 1st returns Decemeber 25, 2004, RIGHT
The 2nd returns the first day of the date dimension, WRONG
The 3rd returns the first day of the date dimension, WRONG

it's not clear to me why the 2nd and 3rd are not right. Could any
expert help me figure out the reason?

Thanks in advance.

Charles


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

Default Re: AS 2005 MDX ParallelPeriod used in calculated member - 12-29-2005 , 11:25 PM






Hi Charles,

Not sure how your Date dimension is structured, but you can compare it
to Adventure Works, where this works:

Quote:
select {[Measures].[Order Count]} on columns,
ParallelPeriod([Date].[Calendar].[Month], 1,
ClosingPeriod([Date].[Calendar].[Date],
[Date].[Calendar].[Date].[December 25, 2003])) on rows
from [Adventure Works]
Quote:
The result on rows is [November 25, 2003]


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