Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Analysis Server and Reporting Services (2008)
 MDX START & END DATE

Author  Topic 

OBINNA_EKE
Posting Yak Master

234 Posts

Posted - 2013-05-16 : 06:53:11
I have a question with my role playing dimension (START/END Date), the equivalent query in T-SQL is shown below

SELECT ACTUAL,SLA_ID, EVENT FROM DBO.TBL_CONSOLIDATED_SLA_B
WHERE START_TIME >=@FROMDATE AND END_TIME <=@TODATE AND SLA_ID =3

I have created the Cubes & Dimensions and I now have Date as dimension.
and Start Date, End Date as (ROLE PLAYING DIMENSION)

I have tried below to implement the same functionality in MDX but the result is not right (I think I am doing something wrong).
The actual value in MDX is bigger that the SQL VERSION. Any Code help will be appreciated.


SELECT
NON EMPTY ({[Measures].[ACTUAL],[Measures].[EVENTS] }) ON 0,
NON EMPTY({[SLA].[SLA NAME].[SLA NAME].ALLMEMBERS},[SLA].[SLA ID].&[3]) ON 1
FROM [SLACube]
WHERE
(
{[START DATE].[Calender].[Day Month Year].&[01 January, 2013]: NULL}
,{NULL : [END DATE].[Calender].[Day Month Year].&[10 January, 2013]}
)


Note: This example did not work for me.

[url]http://www.purplefrogsystems.com/blog/2013/04/mdx-between-start-date-and-end-date/[/url]

If it is that easy, everybody will be doing it

ditch
Master Smack Fu Yak Hacker

1466 Posts

Posted - 2013-05-27 : 09:08:56
I think the problem here is a design issue.
Having 2 time Dimensions can cause some confusion.

I try to keep 1 time Dimension across cubes by assigning the time dimension a standard key which in some cases needs to be derived in sql somehow.


Duane.
Go to Top of Page
   

- Advertisement -