I’m stuck on a MDX query… I have a table which looks like:
Date Client Amount
---------------------------------
2010-01-01 1 1000
2010-01-01 2 500
2010-01-02 1 1100
... ... ...
2011-09-30 3 2000
Basically, I’d like to have a MDX equivalent of the following T-SQL:
SELECT [Year], [Month], AVG(DailyTotal)
FROM (
SELECT [Year], [Month], [Day], SUM(Amount) as DailyTotal
FROM Table
GROUP BY [Year], [Month], [Day]
)
GROUP BY [Year], [Month]
I’m trying to get as result like
Jan ... Sept
2010 AVG ... AVG
2011 AVG ... AVG
Thanks in advance
I have a query using Adventure Works:
In this query I’m using 2 hierarchies ([Date].[Calendar] and [Date].[Month of Year]). Maybe, in your case, you could need do something else if your time dimension have others hierarchies.