Quantcast
Channel: SQL Server Analysis Services Forum
Viewing all articles
Browse latest Browse all 2472

MDX Query to calculate the sum of a measure though the Years and Quaters

$
0
0

Hi there,

I have to build one report using a SSAS cube and I need a MDX query for the data set as following:

I have a Calendar Dimension (Year, Quater, Month, Date), the Dimension 1 and the [Measure].[Value]

In my report I will have 3 parameters:

YearFrom  (value of the example above = 2008)

YearTo  (value of the example above = 2009)

Quater (value of the example above = Q3)

At the moment I am trying to build the MDX query outside the Report Builder as:

WITH 
MEMBER [CountofEventsActualQuarter] AS
[Measures].[Value]

MEMBER [CountofEventsActualQTD] AS
sum({[Calendar].[Quarter].&[Q1]:[Calendar].[Quarter].&[Q3]}, [Measures].[Value])

MEMBER [Difference] AS
[ActualQuarter]-[ActualQTD]

 
SELECT  { [ActualQuarter],[ActualQTD],[Difference] } ON COLUMNS, 
 
{ [Dimension1].[Dimension1].[Dimension1].ALLMEMBERS } 
DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS 
 
FROM [Cube]
WHERE ([CIDRCalendar].[Quarter].&[Q3])

But I am not even close, could any one help me with that?

Thank you very much and best regards,

Joss


Viewing all articles
Browse latest Browse all 2472

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>