Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Analysis Server and Reporting Services (2005)
 Problem to findout the moving total

Author  Topic 

anthu_soft
Starting Member

8 Posts

Posted - 2010-02-08 : 00:49:46
I have an issue for calculating moving total for last year.
I have written a MDX for calculating moving total at day level. It works well for all year but not for the leap year.
Say for example for March 1st of 2007 is moved into February 29th of 2008. In my case it should be shown in March 1st of 2008.
This is my result set

I have followed the below MDx query for the calculation
Member [WeekAndVal] as
(iif(isleaf([Time].[All Years-Week].CurrentMember),
Aggregate( { parallelperiod( [Time].[All Years-Week].[Day],
365, [Time].[All Years-Week].Currentmember).lag(2):parallelperiod( [Time].[All Years-Week].[Day],
365, [Time].[All Years-Week].Currentmember )},[Measures].[POS Value]) ,
aggregate( {ParallelPeriod( [Time].[All Years-Week].[Year], 1,
[Time].[All Years-Week].CurrentMember ).Lag(2):ParallelPeriod([Time].[All Years-Week].[Year], 1,
[Time].[All Years-Week].CurrentMember )},[Measures].[POS Value] )))

How can I rectify this issue?
Urgent reply needed.

Thanks in advance
Anthuvan
   

- Advertisement -