Recursive MDX works just like recursive sql. Here's and example ....
WITH
MEMBER RunningTotal AS
CASE
WHEN
ISEmpty([Date].[Date].PrevMember)
THEN 0
ELSE
Sum
(
[Date].[Date].PrevMember
,[Measures].RunningTotal
)
END
+
Sum
(
(
[Date].[Date].CurrentMember
,([Date].[Calendar Weeks].[Calendar Week].&[27]&[2003],[Measures].[Order Count])
)
)
SELECT
{
[Measures].[Order Count]
,RunningTotal
} ON 0
,[Date].[Date].[Date] ON 1
FROM [Adventure Works]
WHERE [Date].[Calendar Weeks].[Calendar Week].&[27]&[2003];
Thursday, April 8, 2010
Subscribe to:
Posts (Atom)