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

Similar Messages

  • @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;

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

  • 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

  • Ending Inventory / Balnce using @Prior

    On 9.3.1 and my time dimension spans two dimensions (Periods and years).
    Measures in outline:
    Inventory (LabelOnly)
    ----OpeningInventory (store)
    ----Additions (store)
    ----Sales (store)
    ----EndingInventory (store)
    Years (labelOnly)
    ----2010
    ----2011
    ----2012 (is &year1)
    ----2013 (is &year2)
    CalcScript :
    Fix(forecast,working,&year1,&year2,@relative(entity,0),@relative(products,0))
    SET CREATENONMISSINGBLK ON;
    /* LOOP(12) */
    OpeningInventory
         IF(@ISMBR(&Year2) and @ISMBR(Jan))
              OpeningInventory= &Year1->Dec->EndingInventory;     /* basically @MDshift */
         IF(NOT @ISMBR(Jan))
              OpeningInventory=@PRIOR(EndingInventory);
         ENDIF;
         EndingInventory=OpeningInventory+Additions-Sales;
    /* ENDLOOP */
    SET CREATENONMISSINGBLK OFF;
    EndFix
    Sometimes, (without using LOOP as comented above), the value of the EndingInventory of the previous month is not available when OpeningInventory is calculated
    Am I missing some thing?
    And also is &Year1 calculated before &Year2 (as per the member oder in outline), so that Year1's December EndingInventory is available while calculating Year2's January OpeningInventory? or do I need LOOP, would like to avoid LOOP as it increases calc time?
    Also looked at How to link an opening balance to prior period ending balance?
    Appreciate your help.
    Thanks

    Hi,
    We had similar situation and changed the script as below. Added Ending Inventory equation in both if and Else statments also.
    Though it is not required, this way, it worked perfect.
    IF(@ISMBR(&Year2) and @ISMBR(Jan))
    OpeningInventory= &Year1->Dec->EndingInventory; /* basically @MDshift */
    EndingInventory=OpeningInventory+Additions-Sales;
    IF(NOT @ISMBR(Jan))
    OpeningInventory=@PRIOR(EndingInventory);
    EndingInventory=OpeningInventory+Additions-Sales;
    ENDIF;
    Edited by: PadmajaV on Aug 27, 2011 2:29 AM

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

  • 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"))

  • How to get NEXT/PRIOR member's name (Hyperion Planning)

    Hello!
    How can I get the name of the member prior or next to current or even mdshifted?
    The main task is calculate the sum of the 12 month starting from the next.
    Something like this:
    @SUMRANGE(MbrName, @XRANGE (@CURRMBR(Period), Dec)) +
    @SUMRANGE(MbrName, @XRANGE (Jan->NextYear, @CURRMBR(Period)->NextYear)) -
    MbrName->@CURRMBR(Period);
    Thanks

    You are right, @RSIBLINGS can't help you.
    This is resolution without UDA:
    IF (@ISLEV("Period", 0) AND NOT @ISMBR (BegBalance))
    @SUMRANGE("Account_1", @CURRMBRRANGE("Period", LEV, 0, 1))+@SUMRANGE("Account_1"->&NextYear, @REMOVE(@CURRMBRRANGE("Period", LEV, 0, , 0), @LIST("BegBalance")));
    ENDIF;

  • @PRIOR unexpected behavior

    Hi,
    I have a BR with the following calculation:
    FIX( ..., "Jan":"Dec", ... )
    "CMR031"(
    IF(@ISMBR("Jan"))
    "CMR031"="CMR034"->"Dec"->&PrevYear;
    ELSEIF(@ISMBR("Feb":"Dec"))
    "CMR031"=@PRIOR("CMR034");
    ENDIF
    ENDFIX
    The issue is that when I run the BR, the value for CMR031 is correct for Jan only. From Feb onwards till Dec, the value isn't correct. When I run the rule again the value of Feb is calculated correctly, however the value from Mar onwards till Dec is incorrect. I have to run the same rule 11 times to get the complete results. Each iteration calculates the correct value for the next incorrect month.
    I have also tried the MDSHIFT function as @MDSHIFT("CMR034",-1,"Period",); but still faced the same issue.
    Can anyone please help me understand why I might be getting this problem? And how may I fix it?
    Regards,
    Shehzad

    Hi!
    1. Could you try to remove periods from fix (I suppose period as dense ( part of a block))
    2. minor change to script as follow
    FIX( ..., ... )
    "CMR031"(
    IF(@ISMBR("Jan"))
    "CMR031"="CMR034"->"Dec"->&PrevYear;
    ELSE
    "CMR031"=@PRIOR("CMR034");
    ENDIF;
    ENDFIX
    Hope this could help..
    kind regards
    user 637777

  • Averaging an member of a range list of prior year

    Hi our requirement is :
    Account1-> Budget = Avg of Account1 of prior year from Jun to Mar ->Actual+ Avg of Account1 of prior to prior year for Apr & May->Actual
    I tried with @Avgrange & @ Prior but without success.
    Can anyone provide a soulution?
    Thanks in advance..

    I think you might actually be better off using substitution variables for the years. MDShift works great but does not work in combination with other functions such as AVG or SUMRANGE. In some of my formulas, I use MDSHIFT and list out all the months instead of using a sum. It's pretty ugly but it does work. Here's a brief example:
    IF (@ISMBR("JAN")).....
    ELSEIF (@ISMBR("SEP")) (@MDSHIFT("ADMIN FEE"->OCT,-1,YEARS,)+@MDSHIFT("ADMIN FEE"->NOV,-1,YEARS,)+@MDSHIFT("ADMIN FEE"->DEC,-1,YEARS,)+@SUMRANGE("ADMIN FEE",JAN:SEP));
    ENDIF
    In the example, if the month I am calucating is September, I want to take the data from Oct through December of last year and add it with the data from January to September of the current year so that I had a true year's worth of data. Let me know if you'd like me to clarify further. Good luck.

  • How can I use one Add-on prior to another for specific MIME-types?

    I'm using Shockwave Flash plugin to watch some videos on YouTube, StreamCloud, etc. It also handles .mkv and .mp4 files/streams. After installing VLC Web plugin to handle MIME-types like mp3/4, mkv additionally and prior to the Flash plugin, Firefox keeps using Flash to handle those types insted. I cannot find options to set the desired priorities. Only disabling the Flash plugin solves my problem, but also keeps me from watching Flash contents, which Is not acceptable.
    Did I miss something or is this Firefox's fault?

    If you type or paste '''about:plugins''' in the address bar and press Enter, you can see which plugins are associated which various content types.
    I do not know how to prioritize one over the other for the same content type if the plugin settings (plugins often have an interface outside of Firefox to adjust their settings) do not allow that.
    As for MP4, I don't think Flash normally would be selected. I suspect the website is specifying a Flash media player and streaming the MP4 through that. If you want to hide the Flash plugin from a particular website, you can use the Permissions tab of the Page Info dialog.
    Click the padlock or globe icon in the address bar, then More Information, then Permissions. The top section of the Permissions panel should be "Activate Plugins". Here you can select Block for Flash for the current site. After reloading the page, does the media play using a different plugin?

  • How do I delete a prior month(s) or entire year(s) in iCal on my iMac (using version 4.0.4 (1395.7)?  Want to delete all months in 2009

    I checked what was previous asked in deleting months from iCal; however, that question pertained to removing events from a month and not necessarily deleting the entire month.  I have three years of calendars (January - December x three) in my iCal and want to delete all months for 2009 and 2010; however, I can't seem to find a way to delete.  I checked preferences/advanced under iCal but no mention of deleting previous months/years.

    Greetings Judith,
    Before making any attempts at deleting calendar data, backup what you have just in case:
    Click on each calendar on the left hand side of iCal one at a time highlighting it's name and then going to File Export > Export and saving the resulting calendar file to a logical location for safekeeping.
    iCal has an automated function located in iCal > Preferences > Advanced > Delete events "X" days after they have passed.  By typing in a value for days you can tell iCal to delete all events before that time frame.
    Example:
    Today is 4-16-2012.
    If I wanted to delete all events prior to 1 year ago (4-16-2011) I would type in "365" for the number of days.
    Once you type in the number of days you want kept in iCal, close the preferences and then quit iCal.
    Re-open iCal and check to see if the events are gone.  If not you may want to leave it open for several minutes and then quit again.
    Once the events are removed go back to  iCal > Preferences > Advanced > Delete events "X" days after they have passed and make sure the check mark is removed to prevent future deletion.
    Hope that helps.

  • SSRS Matrix report. Variance expression by Month. Need to compare month from prior year to current month of current year VS2010

    Please help.  I have a matrix report.  In the report I have row group  PO Type.  One the Column groups I have a parent group by Fiscal Year, and then a child group by Month.  When I run the report, I get two years of data back broken
    out by month.  Please see below.
    Now here is where I am getting stuck.  I need to take the variance between the current month of the current year, from the same month of the prior year.  So I need to show the difference between Oct , 2014 from Oct, 2013. November, 2014 from November
    2013... etc. etc.
    In the example below, how do I create a column or row showing the variance for Contracts for October 2014.  I need to take the contracts for October 2014 which is 3 and subtract that from October 2013 which is 8.  Any suggestions? How do I do that
    for each month?  Then I need to do it for the quarter... then the year?  But I'll be happy if I can just get the month working first.
    Any help will be appreciated. 
    here is what my rdl file looks like.
    Here is what my report looks like when I render it.

    Hi Adrian_s2012,
    According to your description, you want to compare values for the month of current year with the month of prior year and get the variance. Right?
    In Reporting Services, we don't have any function to get this "Year to Year" Growth. In this scenario, if you data source is a cube, we suggest you use Analysis Services to achieve your requirement. If this data source is just from database, it will be hardly
    to calculate the variance because we need to compare the values within every two different column group and matrix generate adjacent columns one by one. Even we make it by using custom, every time executing the long code when generating result
    in a cell will reduce a lot of performance, we really don't suggest to do that in SSRS. Here is a thread with much easier requirement, please take a reference of that:
    http://social.msdn.microsoft.com/Forums/office/en-US/842e2dcb-d949-4297-9d91-eac989692cb5/difference-between-the-grouped-column?forum=sqlreportingservices
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • My iPhone 5 is not being recognized by my Onkyo TX-8050 reciever when plugging into the USB.  Is there a setting on my phone i need to set?  Also, it has worked prior with this receiver however after the new software update will not work.

    I am trying to hook up my iPhone 5 to my Onkyo TX-8050 receiver and it is not recognizing the phone. It recogized my phone prior to software update 7.1.2 and I can use an iPhone 4 and iPad with no issues.  Is there a setting I need to apply for the reciever to recognize?

    Im presently on the Phone with Apple the Lady Im talking to understands its the id and not the password. I finally got somebody that listened to me. Wow and she is plesent to talk to.

Maybe you are looking for

  • Use iMac speakers as center speaker?

    Hi, i'm considering migrating from PC to an iMac (late 2013) but i don't want to lose my 5.1 setup which i spent my life building. I'm evaluating some alternatives and one of those is this one: I own a yamaha amplifier with DTS/Dolby decoder. I'd lik

  • Query on BAPI -LSMW

    Hi All, I have a requirement on LSMW,  Can any body send me step-by-step procedure to create SD-pricing conditions by using BAPI in LSMW. Thanks, Naga

  • Calculated

    I have a table which i am going to use in my cube by making a view on that table. I also want to create a calculated column  using the columns in that table. Now I want to know which is better in terms of processing time and other aspects: to create

  • Tranffer db to another host

    hellow to everyone, i need help here/// i have sap system with sql db- thay are on the same host now i want to transfer the db to another host... i would like to know how to excute this .. step by step if someone can tell me thanks alot yossi

  • Define pattern with transformed selection?

    (PS CS5 or PS CS6, Windows 7 64 bit) I hope someone can help me puzzle out what is happening here.  I want to select part of an image to turn into a pattern. If I make a selection using the Rectangular Marquee Tool, I can go to Edit - Define Pattern