![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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. |
#3
| |||
| |||
|
| Sum({[Session Dt]. |
#4
| |||
| |||
|
| Sum({[Session Dt]. |
#5
| |||
| |||
|
#6
| |||
| |||
|
#7
| |||
| |||
|
#8
| |||
| |||
|
#9
| |||
| |||
|
#10
| ||||
| ||||
|
| With Member [Measures].[zScoreStatus] as |
| SQL Server 2005 Books Online |
![]() |
| Thread Tools | |
| Display Modes | |
| |