dbTalk Databases Forums  

Quarters (End Date) based upon the Year Parameter

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


Discuss Quarters (End Date) based upon the Year Parameter in the microsoft.public.sqlserver.olap forum.



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

Default Quarters (End Date) based upon the Year Parameter - 11-17-2006 , 03:11 AM






Hi,

I would like to find the quarters (End Date) based upon the Year Parameter.
The MDX query is written as under,Plese check the commented block of the
query.

WITH
MEMBER [Measures].[ParameterCaption]
AS '[V Period].[EndDate].currentmember.MEMBER_CAPTION'
MEMBER [Measures].[ParameterValue]
AS '[V Period].[EndDate].CURRENTMEMBER.UNIQUENAME'
MEMBER [Measures].[ParameterLevel]
AS '[V Period].[EndDate].CURRENTMEMBER.LEVEL.ORDINAL'
SET [ForQuarter]
As
' [V Period].[AssignedYear - PeriodQuarter - PeriodMonth -
EndDate].[PeriodQuarter]'

SELECT {[Measures].[ParameterCaption], [Measures].[ParameterValue],
[Measures].[ParameterLevel]} ON COLUMNS ,
IIF(STRTOMEMBER(@Frequency).MemberValue="Yearly",
Tail([V Period].[EndDate].[Enddate]),
/*
IIF(STRTOMEMBER(@Frequency).MemberValue="Quarterly ",
descendants([V Period].[EndDate].[Enddate]),[V Period].[EndDate].[Enddate]))

*/
ON ROWS
From (SELECT(STRTOSET(@Year,CONSTRAINED)) on 0
FROM [Textile BI])



Thanks




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

Default Re: Quarters (End Date) based upon the Year Parameter - 11-20-2006 , 03:54 PM






Could you explain the [V Period] dimension structure, as also the intent
of the commented block, a bit better? There seems to be a Quarter level:

[V Period].[AssignedYear - PeriodQuarter - PeriodMonth -
EndDate].[PeriodQuarter]

But the commented code refers to a level which is presumably that of the
individual date:

[V Period].[EndDate].[Enddate]


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