Problem to findout the moving total

  • 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.

    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] )))

    I want to add my result set with this but i couldn't.

    How can I rectify this issue?

    Urgent reply needed.

    Thanks in advance

    Anthuvan

  • Please don't cross post. It just wastes peoples time and fragments replies.

    No replies to this thread please. Direct replies to: http://www.sqlservercentral.com/Forums/Topic861431-17-1.aspx

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply