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
- Deepak
Deepak Puri
Microsoft MVP - SQL Server
*** Sent via Developersdex http://www.developersdex.com ***