dbTalk Databases Forums  

MDX Question: Period over Period moving average

comp.databases.olap comp.databases.olap


Discuss MDX Question: Period over Period moving average in the comp.databases.olap forum.



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

Default MDX Question: Period over Period moving average - 10-03-2005 , 07:36 PM






I'm pretty new to MDX and I'm trying to create a calculated member to
add to my cube based on the following dimension structure:


Year
Qtr
Month
Day (2005-10-03)
DateHour (2005-10-03 05:00)


What I need to do is create an 30 day moving average by hour of day.
So if the member I'm on is 2005-10-03 05:00, get the 05:00 hour of
every day for the last 30 days and average them, all other hours being
excluded.


Right now I have the following MDX:


Avg
(
[Session Dt].[Year - Qtr - DatePartMonth - Day -
DateHour].CurrentMember.Lag(30) :
[Session Dt].[Year - Qtr - DatePartMonth - Day -
DateHour].CurrentMember,
[Measures].[Not Registered]
)


The problem here is that it just gives me the last 30 hours, I need a
way to have the set being averaged be just the members with the same
hour of day as the member I'm on.

-------------------
Randy Knight
Sr. Database Engineer
match.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.