dbTalk Databases Forums  

PeriodstoDate Range Syntax Problem

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


Discuss PeriodstoDate Range Syntax Problem in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
jhdubose (Offline)
Junior Member
 
Posts: 2
Join Date: Jul 2006

Talking PeriodstoDate Range Syntax Problem - 07-26-2006 , 10:30 AM






I can't get the PeriodstoDate Range Syntax to work through Project Server OLAP when creating Views.

I should not have to be a MDX expert to get a simple report !

This is the command I am trying.

Round(Sum(PeriodsToDate(Year, [Time].[2006].[Q2].[May].[17]:[Time].[2006].[Q3].[July].[25]),[Measures].[Actual Work]),0)

Of course, I have tried every combination of brackets and parenthesis with and without the "Year", etc....except of course the correct one.

Any help would be greatly appreciated.

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

Default Re: PeriodstoDate Range Syntax Problem - 07-26-2006 , 07:06 PM






Well, it's not clear from the query why PeriodsToDate() is needed (if,
indeed, you're simply trying to sum the measure over the specified date
range). The optional 2nd argument for PeriodsToDate() should be a
member, not a range:

http://msdn2.microsoft.com/en-us/library/ms144925.aspx
Quote:
SQL Server 2005 Books Online

PeriodsToDate (MDX)

Returns a set of sibling members from the same level as a given member,
starting with the first sibling and ending with the given member, as
constrained by a specified level in the Time dimension.

Syntax

PeriodsToDate( [ Level_Expression [ ,Member_Expression ] ] )
...
Quote:
So, something like this might suffice:

Round(Sum(
{[Time].[2006].[Q2].[May].[17]
:[Time].[2006].[Q3].[July].[25]},
[Measures].[Actual Work]), 0)


- Deepak

Deepak Puri
Microsoft MVP - SQL Server

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


Reply With Quote
  #3  
Old   
jhdubose (Offline)
Junior Member
 
Posts: 2
Join Date: Jul 2006

Default Thanks for the reply - 07-27-2006 , 10:52 AM



It appears that when creating a view in Project Server ,that uses OLAP, that the charting engine always charts/graphs the curve out to the end of the Project no matter what. Although the suggestion you had does sum correctly the work in the date range the chart still charts out that total between the ranges on out to the end of the project.

This appears to be a Project Server View issue rather than a MDX issue.

Thanks,

Jason

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.