Question : SSAS 2008 MDX All Member Before Current Member

Hello,

We have an issue with an MDX Calculation we are attempting to construct.

We have a very small test cube that contains two dimensions (DimTask and DimDate) and one measure group (FactTasks) with one measure (Quantity)

We are trying to acheive a calculation that will give us all of the members of the DimDate Dimension that PRECEED the CURRENTMEMBER Date Property. We have tried using the ASCENDANTS Navigation Function, but this simply gives us a Calculation that includes ALL Members, both before and after the Given Date Member.

In SQL, we would want achieve this by using the following WHERE Clause:

WHERE TaskStartDate < @StartDate

In MDX, we would like to achieve something similar. Please see the code snippet for what we have thus far. I have also attached a screen shot of an Excel Pivot of the Cube

When we run that MDX Script, we get 14978 returned, which is the DEFAULTMEMBER. I would however expect to get 14693 (14978 - 139 - 146) which is highlighted in yellow.

Could anyone point us in the right direction ?

Thanks in advance



1:
2:
3:
4:
5:
6:
7:
8:
9:
SELECT 
	{[Dim Task Type].[Task Type].&[CS Team Call Back]} ON COLUMNS,
	[Measures].[Quantity] ON ROWS
FROM [DRL Data Mart Tasks]

WHERE 
  (
    ASCENDANTS([Dim Date Hour].[Calendar Dates Hierarchy].[Date].&[2010-06-13T00:00:00])
  )
Attachments:
 
Excel Pivot of Task Cube
Excel Pivot of Task Cube
 

Answer : SSAS 2008 MDX All Member Before Current Member

Try this:

SELECT
      {[Dim Task Type].[Task Type].&[CS Team Call Back]} ON COLUMNS,
      [Measures].[Quantity] ON ROWS
FROM [DRL Data Mart Tasks]

WHERE
  (
    {[Dim Date Hour].[Calendar Dates Hierarchy].[Date].First:[Dim Date Hour].[Calendar Dates Hierarchy].[Date].&[2010-06-13T00:00:00])
  )

Use the : operator to define range of members for the set.

best regards
Grzegorz
Random Solutions  
 
programming4us programming4us