dbTalk Databases Forums  

Finding the Average of Parallel Periods in AS2000

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


Discuss Finding the Average of Parallel Periods in AS2000 in the microsoft.public.sqlserver.olap forum.



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

Default Finding the Average of Parallel Periods in AS2000 - 09-27-2006 , 12:30 PM






I need some help getting the average value for a measure for parallel
months. I have a measure called Disbursements which is sporadically
populated on a monthly basis (goes back to Jan '05 right now. If I am
looking at Feb '09 I would like to see the average disbursements for
all prior February months ('08,'07,'06,'05). How could this be done in
AS2000?

Scott


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

Default Re: Finding the Average of Parallel Periods in AS2000 - 09-27-2006 , 05:48 PM






Hi Scott,

Here is a sample Foodmart query, which depends on the regularity of the
Time hierarchy, ie. that each year has the same structure under it. This
only works for levels below year (month and quarter in this case).

Quote:
With Member [Measures].[AvgYearlyShipped] as
'Avg([Time].[Year].Members
- {{[Time].CurrentMember} as TC},
([Measures].[Units Shipped],
Cousin(TC.Item(0).Item(0), [Time].CurrentMember)))'
select {[Measures].[Units Shipped],
[Measures].[AvgYearlyShipped]} on 0,
[Time].[Month].Members on 1
from Warehouse
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.