@MDSHIFT

I am writing a calc script for Hyperion Planning 11.1.1.2 that will calculate new maintenance revenue for 15 months based on on accumulation of license revenue with a 60 day delay.
A simple example is:
Year 1 Jan = 0
Feb = 0
Mar = Jan * rate
Apr = Jan * rate + Feb * rate
May = Jan * rate + Feb * rate + Mar * rate
ETC.....
Year 2 Jan = (Jan * rate + Feb * rate + Mar * rate .... Nov * rate of Year 1)
Feb = (Jan * rate + Feb * rate + Mar * rate .... Dec * rate of Year 1)
Mar = (Jan * rate + Feb * rate + Mar * rate .... Dec * rate of Year 1) + Jan * rate of Year 2
I am using @PRIOR to get data that is in the same year as the month that I am calculating and @MDSHIFT to gather data from the prior year.
I am fixing on either all level 0 members or a specific level 0 member.
A portion of my calc is below:
FIX (@levmbrs("Division",0), @LEVMBRS ("Channel",0), @levmbrs("Industry",0), @levmbrs("location",0))
FIX ("E_HSI_Input", @levmbrs("Department",0), "Loc_Curr")
"4350_New_Maint"(
IF(@ISMBR(&RollFcstBegYr))
"4350_New_Maint" -> "D0200" = (@PRIOR(("4000" -> "D0100"),2)
*(@PRIOR(("4350_Rate" -> "E_None" -> "D0000" -> "L000" -> "Ind000" -> "C0" -> "Loc_Curr"),2) / 12))
+ @PRIOR ("4350_New_Maint" ->"D0200",1);
     ELSEIF(@ISMBR(&RollFcstEndYr) and @ISMBR("Jan"))
     "4350_New_Maint" -> "D0200" = @MDSHIFT (("4000" -> "D0100"), -1, "Fiscal_Year",,11,"Time_Period",)
*((@MDSHIFT(("4350_Rate" -> "E_None" -> "D0000" -> "L000" -> "Ind000" -> "C0" -> "Loc_Curr" -> "Nov"),-1,"Fiscal_Year",)) / 12)
+ @MDSHIFT("4350_New_Maint",-1,"Fiscal_Year",,11,"Time_Period",);
     ELSEIF(@ISMBR(&RollFcstEndYr) and @ISMBR("Feb"))
"4350_New_Maint" -> "D0200" = @MDSHIFT (("4000" -> "D0100"), -1, "Fiscal_Year",,11,"Time_Period",)
*((@MDSHIFT(("4350_Rate" -> "E_None" -> "D0000" -> "L000" -> "Ind000" -> "C0" -> "Loc_Curr" -> "Dec"),-1,"Fiscal_Year",)) / 12)
+ @PRIOR ("4350_New_Maint",1);
     ELSE
     "4350_New_Maint" -> "D0200" = (@PRIOR(("4000" -> "D0100"),2)
*(@PRIOR(("4350_Rate" -> "E_None" -> "D0000" -> "L000" -> "Ind000" -> "C0" -> "Loc_Curr"),2) / 12))
+ @PRIOR ("4350_New_Maint" ->"D0200",1);
     ENDIF;)
The &RollFcstBegYr substitution variable is set to my year 1 and works fine. Where I am having trouble is getting the Jan and Feb portions of &RollFcstEndYr (which is my year 2) to work correctly.
I am putting in rates at L000, Ind000, and C0 which are level 0 members of my location, industry and channel dimensions. The revenue that the calc is looking for might be sitting in another location, industry or channel.
What I want the calc to do is take the rate at L000, Ind000 and C0 and multiply it times the revenue number at all of the level 0 members of location, industry and channel. It is not doing that. It is only calculating where the revenue is also sitting at L000, Ind000 can C0, not the other intersections.
Any help with resolving this will be GREATLY appreciated.

I have it shifting on year also because I want it to get the rate that was entered in the same period as the revenue (i.e.: Nov year 1 rev * Nov year 1 rate). My rate and revenue by period is coming back fine as long as I look at the intersections only where there is a rate. It's something with the different locations, industries, and channels. Even though it looks to me like it should work on all level 0 members it is not. I'm thinking I've somehow limited it to only the intersections that have an actual rate entered, when I want the rate applied to all level 0 members. I just don't see what's causing that.

Similar Messages

  • Issue with substitution variable with @MDSHIFT in BR in Calc Manager

    Hi Experts,
    We have a BR in EAS which is working fine.
    and exported to Calcmanager, now while validation it is giving error "@BaseScenario" is not found.
    the code is
    @MDSHIFT("LFLSalesIncVAT_GBP_C_DHP"->&BaseScenario->"Final"->"CD_FinalPlanPL",-1,"Year",,1,"Period",);
    if i hard code it like @MDSHIFT("LFLSalesIncVAT_GBP_C_DHP"->"P7PP"->"Final"->"CD_FinalPlanPL",-1,"Year",,1,"Period",); working fine.
    is there any limitation with calc manger and substitution variables?
    Thanks
    GP

    There seems to be many issues with validations in calc manager, does the rule run if you dont validate.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Problem with a calc involving @MDSHIFT and Dynamic Calc

    Hi all,
    I have a problem with the calculation of a member in a calc script. The formula of this member is :
    "R70100"
    IF(@ISMBR("M01"))
    ("T_008"->"Cumul"->"HT"+"T_003"->"Cumul"->"HT")*"AVCT_PR" - @MDSHIFT("R70100" -> "Cumul" -> "HT" -> "M12", -1, "Year", );
    ELSE
    ("T_008"->"Cumul"->"HT"+"T_003"->"Cumul"->"HT")*"AVCT_PR" - @MDSHIFT("R70100" -> "Cumul" -> "HT", -1, "Period", );
    ENDIF
    - R70100 is a member of a dense dimension.
    - T_008, T_003 and AVCT_PR are spare and stored.
    - "Cumul" is a dynamic member which allow us to calculate cumulative from monthly.
    - Time is split into two dimensions, Period and Year.
    The problem is that the @MDSHIFT doesn't seems to work with the dynamic calc as the monthly result is the cumulative correct value. I didn't know what is wrong BUT each time I launch the script, values are good for one more month.
    After one run, for example, I obtained this result :
    !http://zenon.apartia.fr/stuff/200910070001.GIF!
    Two run later, here are the news values :
    !http://zenon.apartia.fr/stuff/200910070002.GIF!
    Any idea on what going on and how to correct it ? Thanks !
    Frédéric

    A couple of questions for you:
    1) Do you need the overhead of @MDSHIFT when you are only moving in one dimension? Wouldn't @PRIOR have been a lot easier? At least this is true for the ELSE condition.
    2) Could you post just the results of the @MDSHIFT calculation so we (okay, this may be just for me, it's still breakfast time here and not enough coffee has been ingested yet to read a spreadsheet without recourse to the formulas) can better see the impact?
    3) Have you tried using your code against a non-dynamic member? Does it make a difference?
    Regards,
    Cameron Lackpour

  • Syntax for @MDSHIFT function

    I'm attempting to create matrix type results for several accounts, displaying a rolling 12 months. An alternate hierarchy is one solution, but would like to try a calcscript using @MDSHIFT."Incomeprior" =@MDSHIFT("MTotalIncome", 1, "2002", , 0,"Income Stmt Accounts",);The error received is "The 2nd parameter of function "2002" must be a non-negative number or Lev/gen name string"Any ideas?Thank you in advance,Cbucklin

    Hi
    definitely
    syntax:- EVAULATE('your db function(%1,%2)', parameter list)
    here %1 and %2 are the no.of parameters (columns or may constant values) to be passed for the db-function
    if you have 3 parameters then you need to use %3 also.. means the columns to be passed.
    following exapmples are for ORACLE db,
    ex1: EVALUATE('upper(%1)', 'kishore kumar') gives the result as -> KISHORE KUMAR
    ex2: EVALUATE('upper(%1)', 'Markets.Region') here Markets.Region is column.
    you also can call the user-defined functions through evaulate
    EVALUATE('functioname(%1,%2), column1, column2)
    the above function has 2 parameters to be inputted
    Thanks & Regards
    Kishore Guggilla
    Edited by: Kishore Guggilla on Jan 16, 2009 11:00 PM

  • Error using @MDShift Function

    I'm trying to create a calc script that will move the prior month's ending balance into the current month's beginning balance. After looking through the technical reference guide, I thought using the @MDshift function would be my best option. My calc script is as follows: FIX ("Test Scenario") "1016 LB Beg Balance" = @MDSHIFT("101600", 1, YTD, -1, Scenario,); ENDFIX Receiving the following error message: Error: 1200366 Error parsing formula for [1016 LB Beg Balance] (line 3): invalid arguments number in macro[@MDSHIFTMBR] What does this error message indicate? Where can I find the information needed to resolve this? A sample of my outline structure is as follows:YTD Time (Active Dynamic Time Series Member Y-T-D, Q-T-D) Quarter 1 03 02 01 Quarter 2 06 05 04Fiscal Year 2003 2004 2005Scenerio Actual Average Budget Test Scenario Any suggestions?

    Is this using Planning?I had the same, fixed it with a loop statement. Loop for the number of years you have plus one (for backcalc). First fix on BegBalance, second on the elements of the time dimension. Hope this formats ok ...Loop(4)Fix(Begbalance)"Beginning Balance" = @mdshift("Beginning Balance", 12,"Time Periods",,-1,Years, );"Ending Balance" = @mdshift("Ending Balance", 12,"Time Periods",,-1,Years, );EndfixEndLoopLoop (4)Fix(@levmbrs(Time,0))"Beginning Balance" = @PRIOR("Ending Balance");"Ending Balance" = "Beginning Balance" - "A" - "B";EndfixEndloopHope this helps.

  • @PRIOR @MDSHIFT

    I need to calculate a Member for FY2012 as follows:
    FIX("Feb")
    "Member1" = "Member2" -> "Jan" + "Member2" -> "Dec" -> "FY11" + "Member2" -> "Nov" -> "FY11" + "Member2" -> "Oct" -> "FY11" + "Member2" ->"Sep" -> "FY11"
    ENDFIX
    FIX("Mar")
    "Member1" = "Member2" -> "Feb" + "Member2" -> "Jan" + "Member2" -> "Dec" -> "FY11" + "Member2" -> "Nov" -> "FY11" + "Member2" -> "Oct" -> "FY11"
    ENDFIX
    ..and so forth.
    this is a simplified formula but basically i want the formula to go back to previous year as well. using @PRIOR but the rangelist can be either period or Year, while in @MDSHIFT it can be in both current year and previous year.. is there a way I can achieve or have to write these detailed formulas by fixing on each month.
    Thank You for your help

    Hi,
    So basically you just want to calculate the last 5 trailing months ?
    To do this I use a variable to calculate the index of the current Period. Then I use a @SUMRANGE and I defined my starting and ending period based on the index of the current period using @HspNthMbr.

  • MDSHIFT help

    Hi,
    I have below formula, and understand it partly. If the Year member is 'Actuals13' then 'Tot_Sales' is back 1 member in the 'FiscalYear' dim..... Then it get's fuzzy with the remainder... How exactly would I explain this in layman's terms?
    IF(@ISMBR (Actuals13)) @MDSHIFT (Tot_Sales, -1 , FiscalYear , , 1 , Week , ) ;

    I think it's.....
    If its FY13 go get total sales from the subsequent week of the prior year. (based on what member it's working on, so if it's week 12 of FY13 it would go to week 13 of FY12?)
    Or if it's FY12 and it's week 53 go get Tot Sales from Week 1.
    For any other period in any other year use the prior weeks Tot Sales.

  • @MDSHIFT for future

    i've been successful in using @MDSHIFT fwhen going backwards in the "Years" dimension, but i can not get it to go forward to the next year in the year dimension. i've read the doc and it says it's similar to PRIOR but, doesn't really say for next. so, is it possible? here's my code. it just returns a 0.
    IF (@ISMBR(Dec) )
    Forecast = @MDSHIFT("Price"->NoDivision, +1,"Years",,+1,"Jan",) ;
    ENDIF
    thks

    @NEXT works on level-zero members of the dimension tagged as Time by default, but you can also specify any range of members. For example (if your Year dimension is 'flat'), something like this might work. Please note I haven't tested, just trying to give a rough idea:
    @NEXT("Price"->"No Division"->"Jan", 1, @CHILDREN("Year"))

  • @MDSHIFT issue with future years

    We have a complex calc on a dynamic member using @MDSHIFT. It works perfectly if we arepointing to past years; but if we point to future year(s), it fails without any error.
    The calc itself validates fine.
    Are there any exceptions for using @MDSHIFT with future years?(we do have forecast data for the future years too)
    Example from our calc script:
    ((@MDSHIFT("Adjust Stat Forecast"->"Forecast"->"Jan",1,"Year",)
    Edited by: 784749 on Mar 10, 2011 1:57 PM

    Hi,
    What do you try to shift? For example: Data from Next Year to current Year?
    You may need to check what member you fix on in the calc, the problem could be because the fix is not correct or the
    desitination is not correct.

  • MDSHIFT Question

    Essbase 9.3.1
    Cube design
    Measures
    --Fuel Ops
    Periods
    FY2010
    --FY10-Jan
    ----01/01/2010
    etc
    FY2009
    --FY09-Jan
    ----01/01/2009
    etc
    Scenarios
    --Actual
    --Forecast
    Formula: (Create Blocks On Equation is checked in Cube properties)
    FIX (Forecast)
    "Fuel Ops" = @MDSHIFT("Fuel Ops", 365, Periods, , -1, Scenario,);
    ENDFIX
    This formual shifts the data from previous years actual to next years forecast accurately EXCEPT for all periods that do not already have actual data. So I get 11/08/2009 Forecast loaded with 11/09/2008 Actual because I already have actual data for 11/08/2009. However, 11/10/2009 remains #MISSING after calc as do all subsequent dates that have no data stored in them yet.
    What am I missing or how can I accomplish creating a forecast for all future periods?

    Yes, periods is sparse.
    So to FIX on Fuel Ops and calculate on FORECAST my formula would be?
    FIX ("Fuel Ops")
    "Forecast" = @MDSHIFT("Fuel Ops", 365, Periods, , -2, Scenario,);
    ENDFIX
    I'm confused by the first parameter for MDSHIFT. The technical reference states it should be "Any valid single member name or member combination, or a function that returns a single member or member combination, from which the values are to be shifted." which indicates that ACTUAL would be the correct member name from which I am shifting the data. But then it seems my shift counts should be reversed. Since I am shifting ACTUAL UP 365 on the Periods and DOWN 1 on the SCENARIO.
    "Forecast" = @MDSHIFT("Actual", -365, Periods, , 2, Scenario,);
    Or is the reference FROM current member meaning FROM the current member go DOWN 365 on Periods and UP 1 on SCENARIO and get the ACTUAL value you find there . . . or have I just created this in my mind to complicate things? (Actual also seems redundant at that point since I am already directing it to actual from forecast)
    "Forecast" = @MDSHIFT("Actual", 365, Periods, , -2, Scenario,);

  • @MOVAVG,MDSHIFT and PRIOR

    Hi,
    I am new to Essbase and looking forward for your help in order to develop the below scenarios.
    First one
    I need an essbase function that calculates the average of the last three months. so if i am in Apr the value would be the average of JAN,FEB and MAR, i reviewed the @MOVAG but the problem is that it includes the month i am currently calculating in the calculation.
    @MOVAVG Sales of APR = MOVAVG (Sales,3) returns the avg of APR,MAR and FEB, how can i work on this to return the required output which is supposed to be JAN,FEB and MAR
    second one
    I am looking for a function to calculate the last 18 months of an element.
    I used the MDSHIFT to get the values of one year back then the PRIOR function to get the value of the last 6 months, but the issue is MDSHIFT returns a value but the input of PRIOR is a data element.
    Regards,

    Hi ,
    You can also use this concept for your first question,
    FIX("Boston","Stereo","Actual",@RELATIVE("Year",0))
    "COGS"
         IF(@ISMBR("Jan"))
              "COGS" = (@MDSHIFT("Sales",-1,"Year",,9,"Period",) + @MDSHIFT("Sales",-1,"Year",,10,"Period",) + @MDSHIFT("Sales",-1,"Year",,11,"Period",))/3;
    ELSEIF(@ISMBR("Feb"))
              "COGS" = (@MDSHIFT("Sales",-1,"Year",,9,"Period",) + @MDSHIFT("Sales",-1,"Year",,10,"Period",) + @SUMRANGE("Sales","Jan":"Jan"))/3;
    ELSEIF(@ISMBR("Mar"))
              "COGS" = (@MDSHIFT("Sales",-1,"Year",,9,"Period",) + @SUMRANGE("Sales","Jan":"Feb"))/3;
         ELSE
              "COGS" = @SUMRANGE("Sales",@CURRMBRRANGE("Period",LEV,0,-3,-1)) / 3;
    ENDFIX;

  • Dynamic Calc Member with Formula to Calculate a Rolling 13 Year

    I have to create a rollup in my time dimension that will have 13 members representing each month of a 13 rolling forecast. I am having trouble setting this up as dynamic calc members with a formula assigned to it. For example, on of the members has the following formula.
    As you can see, I am referencing several substitution variables since I want to make this as most dynamic as possible without having to make any changes to the formula member. Only making changes to the substitution variable. Any help would be much appreciated.
    IF((@ISMBR(&Current_Year)) AND (&Act_RF_Last_Month == "Jan"));
    "RTM 6" = @MDSHIFT(&Act_RF_Last_Month, -1, "Years", , 5, "Period",);
    ELSE #Missing;
    ENDIF
    IF((@ISMBR(&Current_Year)) AND (&Act_RF_Last_Month == "Feb"));
    "RTM 6" = @MDSHIFT(&Act_RF_Last_Month, -1, "Years", , 5, "Period",);
    ELSE #Missing;
    ENDIF
    IF((@ISMBR(&Current_Year)) AND (&Act_RF_Last_Month == "Mar"));
    "RTM 6" = @MDSHIFT(&Act_RF_Last_Month, -1, "Years", , 5, "Period",);
    ELSE #Missing;
    ENDIF
    IF((@ISMBR(&Current_Year)) AND (&Act_RF_Last_Month == "Apr"));
    "RTM 6" = @MDSHIFT(&Act_RF_Last_Month, -1, "Years", , 5, "Period",);
    ELSE #Missing;
    ENDIF
    IF((@ISMBR(&Current_Year)) AND (&Act_RF_Last_Month == "May"));
    "RTM 6" = @MDSHIFT(&Act_RF_Last_Month, -1, "Years", , 5, "Period",);
    ELSE #Missing;
    ENDIF
    IF((@ISMBR(&Current_Year)) AND (&Act_RF_Last_Month == "Jun"));
    "RTM 6" = @MDSHIFT(&Act_RF_Last_Month, -1, "Years", , 5, "Period",);
    ELSE #Missing;
    ENDIF
    IF((@ISMBR(&Current_Year)) AND (&Act_RF_Last_Month == "Jul"));
    "RTM 6" = @MDSHIFT(&Act_RF_Last_Month, -1, "Years", , 5, "Period",);
    ELSE #Missing;
    ENDIF
    IF((@ISMBR(&Current_Year)) AND (&Act_RF_Last_Month == "Aug"));
    "RTM 6" = @SHIFT(&Act_RF_Last_Month,-7);
    ELSE #Missing;
    ENDIF
    IF((@ISMBR(&Current_Year)) AND (&Act_RF_Last_Month == "Sep"));
    "RTM 6" = @SHIFT(&Act_RF_Last_Month,-7);
    ELSE #Missing;
    ENDIF
    IF((@ISMBR(&Current_Year)) AND (&Act_RF_Last_Month == "Oct"));
    "RTM 6" = @SHIFT(&Act_RF_Last_Month,-7);
    ELSE #Missing;
    ENDIF
    IF((@ISMBR(&Current_Year)) AND (&Act_RF_Last_Month == "Nov"));
    "RTM 6" = @SHIFT(&Act_RF_Last_Month,-7);
    ELSE #Missing;
    ENDIF
    IF((@ISMBR(&Current_Year)) AND (&Act_RF_Last_Month == "Dec"));
    "RTM 6" = @SHIFT(&Act_RF_Last_Month,-7);
    ELSE #Missing;
    ENDIF

    We use similar logic but its in a calc script, not a dynamic formula.
    Here's an example of what we do:
    FIX (&Year, &Scenario)
    IF (@ISMBR("JAN"))
    "Average Usage%" = @AVG(SKIPBOTH, @MDSHIFT("Usage %"->"DEC"->&actYear, -1, "Year",), "Util %"->"JAN"->&actYear);
    ELSEIF
    ENDFIX
    Another example in a different database:
    IF (@ISMBR("JAN")) ((@MDSHIFT("Fees"->APR,-1,YEARS,)+@MDSHIFT("Fees"->MAY,-1,YEARS,)+@MDSHIFT("Fees"->JUN,-1,YEARS,)+@MDSHIFT("Fees"->JUL,-1,YEARS,)+@MDSHIFT("Fees"->AUG,-1,YEARS,)+@MDSHIFT("Fees"->SEP,-1,YEARS,)+@MDSHIFT("Fees"->OCT,-1,YEARS,)+@MDSHIFT("Fees"->NOV,-1,YEARS,)+@MDSHIFT("Fees"->DEC,-1,YEARS,)+"Fees"->JAN)/10)*12;

  • Two different retrieval results on two spreadsheets for same account

    I am encountering some very bizarre retrieval behavior that I've never seen before. The version is 11.1.1.3. I have a dynamically calculated account, which produces a Contract-to-date value for Net Sales.
    The formula is:
    IF(@ISMBR("Jan"))
    @MDSHIFT("CTD Sales", 24, "Period", , -1, "Years", ) + "Net Sales";
    ELSE
    @PRIOR("CTD Sales") + "Net Sales";
    It's always worked correctly as far as I can determine. I took a copy of the outline and put it in my dev system and have been working on some other development. In testing, I noticed that my CTD Sales wasn't retrieving the correct number. This is on a spreadsheet with multiple other accounts on it. It works fine up through FY12, then in January of FY13 and thereafter, produces incorrect numbers, with no apparent pattern of error. So I put just the Net Sales and CTD Sales members onto another spreadsheet, without all of the other stuff, and retrieved that, and it produced the correct numbers. It's not a matter of having a spreadsheet formula in the retrieval spot that I've forgotten about (I've done that before). I also copied the spreadsheet with the wrong numbers, and retrieved in Smart View (was retrieving in Essbase add-in before), and got the same wrong numbers.
    In addition, I actually have three dynamically calculated CTD accounts on the sheet, and the bizarre behavior is happening for all three. With all of the other accounts on the sheet, wrong numbers. With only those accounts on the sheet, correct numbers.
    Also, for more information, one of my calculation scripts uses these CTD members, and it is producing the correct result, so this appears to be isolated purely to spreadsheet retrieval.
    So how can the same exact dimension intersection produce two different numbers on two different spreadsheets? Why would having other account members on a spreadsheet affect the results of one of the accounts? Has anyone ever encountered this before?
    Sabrina

    are you sure you have same combinations from rest of dimensions in both spreadsheets...like retrieving for same month ???Absolutely, 100% sure.
    Also does the difference exists for all months retrieval or only for Jan retrieval?It starts in January and the difference continues for the rest of the months/years after. The amount it's off by changes each year, but remains the same for each month in the year. So Jan through Dec of FY13 are all off by 50,321,000. Jan through Dec of FY14 are all off by 186,378,000. Jan through Dec of FY15 are all off by 351,757,000.
    Also note that if you have a retrieval as shown in the screenshot in the following link... for the last 5 months (AUG to DEC) under FY11 will actually retreive for FY12. this is a wierd behaviour.No, I have the year above each month.
    Sabrina
    Edited by: SabrinaD on Aug 3, 2010 12:31 PM

  • Essbase : Order evalution with dynamic Calc : Account x Scenario

    Hi everybody,
    I'm trying to calculate a variation N / N-1 in % for All Accounts.
    basically : %/ N-1 = (Actual- Actual N-1) / Actual N-1 - I create a scenario.
    I create a scenario %_N_1 which is Dynamic Calc.
    "%_N_1" = ("ACTUAL" - @MDSHIFT( "ACTUAL" , -1 , "Year" , ))/@MDSHIFT( "ACTUAL" , -1 , "Year" , )*100;
    But with agregated Accounts (which are dynamic calc also), Essbase sums the % ... which is wrong !!!
    Question : How could we set the priority between Scenario and Account for Dynamic Calculation.
    regards,
    ps : I want not to put this calculation in Financial Reporting, because there are a lot of reports that use this measure : %_N_1 !

    Two-pass Calc
    You should basically put this on every formula that is a % to make sure it happens after the aggregation stuff.
    It get's tricky if you did two-pass on two pass but I believe you aren't using two-pass so you should be good to go

  • How to calculate a rolling 12 months to date calculation?

    Hi there
    We have a business requirement to calculate a rolling 12 month to date value. That is, for any month, sum up the last 12 months of data. E.g. for June 2011, its May 2010 -> June 2011. We have the standard Year and Period dimension, and the member which holds this calculation is in another dimension called TimeView. TimeView just holds dynamic calculations for Month To Date(MTH), Year To Date (YTD) etc.
    The problem I am having is because we have the standard Year and Period dimensions so I need to do a cross dimensional sum. All the solutions I am trying either give me an insufficient dynamic calc cache (increase lock block setting) or something similar. Our lock block setting is quite high and it doesnt seem to make a difference when I increase it.
    Anyway, I have tried a few solutions:
    Short one:
    @SUMRANGE("MTH",@MDSHIFT(@CURRMBRRANGE(Period,LEV,0,1,),-1,"Year",)) + @SUMRANGE("MTH",@CURRMBRRANGE(Period,LEV,0,,0));
    Long one:
    IF(@ISUDA(ACCOUNT,"Flow"))
         IF(@ISMBR(Jan))
              YTD->Jan + @MDSHIFT(YTD->Dec,-1,"Year",) - @MDSHIFT(YTD->Jan,-1,"Year",);
         ELSEIF(@ISMBR(Feb))
              YTD->Feb + @MDSHIFT(YTD->Dec,-1,"Year",) - @MDSHIFT(YTD->Feb,-1,"Year",);
         ELSEIF(@ISMBR(Mar))
              YTD->Mar + @MDSHIFT(YTD->Dec,-1,"Year",) - @MDSHIFT(YTD->Mar,-1,"Year",);
         ELSEIF(@ISMBR(Apr))
              YTD->Apr + @MDSHIFT(YTD->Dec,-1,"Year",) - @MDSHIFT(YTD->Apr,-1,"Year",);
         ELSEIF(@ISMBR(May))
              YTD->May + @MDSHIFT(YTD->Dec,-1,"Year",) - @MDSHIFT(YTD->May,-1,"Year",);
         ELSEIF(@ISMBR(Jun))
              YTD->Jun + @MDSHIFT(YTD->Dec,-1,"Year",) - @MDSHIFT(YTD->Jun,-1,"Year",);
         ELSEIF(@ISMBR(Jul))
              YTD->Jul + @MDSHIFT(YTD->Dec,-1,"Year",) - @MDSHIFT(YTD->Jul,-1,"Year",);
         ELSEIF(@ISMBR(Aug))
              YTD->Aug + @MDSHIFT(YTD->Dec,-1,"Year",) - @MDSHIFT(YTD->Aug,-1,"Year",);
         ELSEIF(@ISMBR(Sep))
              YTD->Sep + @MDSHIFT(YTD->Dec,-1,"Year",) - @MDSHIFT(YTD->Sep,-1,"Year",);
         ELSEIF(@ISMBR(Oct))
              YTD->Oct + @MDSHIFT(YTD->Dec,-1,"Year",) - @MDSHIFT(YTD->Oct,-1,"Year",);
         ELSEIF(@ISMBR(Nov))
              YTD->Nov + @MDSHIFT(YTD->Dec,-1,"Year",) - @MDSHIFT(YTD->Nov,-1,"Year",);
         ELSEIF(@ISMBR(Dec))
              YTD->Dec
         ELSEIF(@ISMBR(Q1))
              YTD->Mar + @MDSHIFT(YTD->Dec,-1,"Year",) - @MDSHIFT(YTD->Mar,-1,"Year",);
         ELSEIF(@ISMBR(Q2))
              YTD->Jun + @MDSHIFT(YTD->Dec,-1,"Year",) - @MDSHIFT(YTD->Jun,-1,"Year",);
         ELSEIF(@ISMBR(Q3))
              YTD->Sep + @MDSHIFT(YTD->Dec,-1,"Year",) - @MDSHIFT(YTD->Sep,-1,"Year",);
         ELSEIF(@ISMBR(Q4))
              YTD->Dec
         ELSEIF(@ISMBR(H1))
              YTD->Jun + @MDSHIFT(YTD->Dec,-1,"Year",) - @MDSHIFT(YTD->Jun,-1,"Year",);
         ELSEIF(@ISMBR(H2))
              YTD->Dec
         ELSEIF(@ISMBR("YearTotal"))
              YTD->Dec
         ENDIF
    ELSEIF(@ISUDA(ACCOUNT,"First"))
         MTH->Jan;
    ELSE
    MTH;
    ENDIF
    I am sure this may be a common requirement across companies - does anyone know a solution to this?
    Much appreciated!

    Closing this thread, just needed to increase cache levels.

Maybe you are looking for