dbTalk Databases Forums  

average of a month over multiple years using mdx

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


Discuss average of a month over multiple years using mdx in the microsoft.public.sqlserver.olap forum.



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

Default average of a month over multiple years using mdx - 09-08-2006 , 10:57 AM






I am trying to get an average of a month over multiple years using mdx.
e.g.
if my currentmember is 'F06 Aug' I would like to get the AVG(F05
Aug,F04 Aug, F03 Aug,...)

any help will be appreciated.

Ali Rizvi


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

Default Re: average of a month over multiple years using mdx - 09-08-2006 , 10:17 PM






Are you using AS 2000 or AS 2005? With AS 2005, the simplest solution
would be to include a "Month of Year" attribute, as in the Adventure
Works date dimension:

Quote:
With Member [Measures].[AvgMonthOrders] as
Avg(Exists([Date].[Calendar].[Month].Members,
Existing [Date].[Month of Year].Members),
[Measures].[Order Quantity])
select {[Measures].[Order Quantity],
[Measures].[AvgMonthOrders]} on 0,
[Date].[Calendar].[Month].Members on 1
from [Adventure Works]
Quote:

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