Calculate Previous 12 months in ASO

Hello All,
I need to create members in Period dimension based on last 12 months. Like below
MemberA = Jan2013+Dec2012+Nov2012+....+Feb2012
MemberB= Dec2012++Nov2012+....+Feb2012+Jan2012
MemberC=Nov2012+....+Feb2012+Jan2012+Dec2011
etc...
We have separate Year and Period dimensions. Below is the hierarchy
Year
     2013
     2012
Period
     Q1
          Jan
          Feb
          Mar
     Q2
          Apr... etc
Can you please help me to achieve this.
Thanks,
Prathap

Fixed this issue by using the below, Not sure whether this is the correct way or not but its working
CASE
WHEN(IS([FY13], [YEARS].CURRENTMEMBER)) and (ISLEVEL([Period].Jan,0))
THEN Aggregate({[Period].Jan.Lag(-1):[Dec]},[Years].[FY12]) + Aggregate({[Period].Jan},[Years].[FY13])
WHEN(IS([FY12], [YEARS].CURRENTMEMBER)) and (ISLEVEL([Period].Jan,0))
THEN Aggregate({[Period].Jan.Lag(-1):[Dec]},[Years].[FY11]) + Aggregate({[Period].Jan},[Years].[FY12])
WHEN(IS([FY11], [YEARS].CURRENTMEMBER)) and (ISLEVEL([Period].Jan,0))
THEN Aggregate({[Period].Jan},[Years].[FY11])
END
Thanks,
Prathap

Similar Messages

  • With 'Revenue' Fact Column how can i calculate 'Previous 3 Months Revevue'

    Hi All ,
    i have a Column Called Revenue from Fact Table. i need to calculate Previous 3 Months Revevue
    How can i achive this ? please help me
    Thanks in advance

    Hi,
    Create one new logical coloumn bmm layer and
    1.Check Use existing logical columns as the source
    2.Click the Expression Builder button (three dots) to open the Expression Builder
    3.Select Functions > Time Series Functions > Ago.
    by using this u can create 3 months year ago revenue coloumn and use this coloumn in your formula
    hope this will help for you
    Naresh

  • Calculate previous 12 months quantity

    Hello Friends.
    Preparing Consolidated Sales Order Report” for Last 12 months,
    I have to show the qty(wmeng) fields in the output ,every month how much qty was there,
    in my selection screen i am putting month and year,based on that i have to calculate pervious 12 month qty individivally.....
    menas suppose i entered 062007 in my selection screen
    means 06 month 12th
               05 month 11th
               04 month 10th .....so on
    in every month i have to take qty(vbep-wmeng) added individula month , if any body know this logic please help me
    Thanks
    Edited by: Alvaro Tejada Galindo on Mar 25, 2008 5:25 PM

    Hi,
    try to use the FM  bellow to get the previous 12 months date. Then do a loop or while routine to do what you need.
    CALL FUNCTION 'RE_ADD_MONTH_TO_DATE'
    EXPORTING
    MONTHS = '-12'
    OLDDATE = s_date
    IMPORTING
    NEWDATE = V_DATE.
    Hope this help.
    Rodrigo Paisante

  • FM to get previous fiscal month/year and calendar month/year for a date.

    Hi All,
    I am having a requirement to extract some data based on either the previous fiscal month/year or the previous calendar month/year. There is no company code input to find the fiscal/calendar month/year.
    At selection screen, user can select either fiscal or calendar selection.
    Based on the selection, the data will be extracted.
    For the system date, we need to calculate previous fiscal month/year or previous calendar month/year and populate the calculated data back to the selection-screen.
    Can you one of you please suggest an FM to find previous fiscal month/year and previous calendar month/year.
    Thanks in Advance,
    Regards
    Gowthami

    Hi Gowthami,
    You can use following function module to calculate previous / next day or month or year.
       call function '/SAPHT/DRM_CALC_DATE'
          exporting
            date      = sy-datum
            days      =
            months    =
            sign      = '-'
            years     =
          importing
            calc_date = .
    Here, you can give '-' to sign, if you want previous day / month / year.
    Here, you can give '+' to sign, if you want next day / month / year.
    And depending upon your requirement, you can pass suitable value to days / month / year.
    e.g. To calcualte last month,
       call function '/SAPHT/DRM_CALC_DATE'
          exporting
            date      = sy-datum
            days      =
            months    = 1
            sign      = '-'
            years     =
          importing
            calc_date = wv_prev_month.
    so it will give '23-01-2008' . Then convert it in the required format as per your requirement using string function concatenate.
    Hope this help you.
    Regards,
    Anil

  • Is there any standard variable to calculate previous and current month

    hi,
    Is there any standar variable to calculate previous month and current month which will calcualte from system date (sy-date). I found standard SAP Delivered variable - 0CMONTH to calculate current month. But i want both current month and previous month.  IF it is not avialble can you please provide me the ABAP code..
    thanks in advance.

    Hi,
    Check this thread.
    ABAP routine for loading previous months data in infopackage
    Regards.

  • Condition to calculate order quantity with previous 3 months history of act

    Hi,
    We have a requirement of the report is i need to calculate order quantity (SD) with condition that it should have been produced with previous 3 months with finished goods sales quantity (MM), please suggest suitable formula so that order quantity should be calculated only if it was produced with previos 3 months of finished goods quqntity. Thank you
    Regards,
    Manju

    Hi Geeta,
    Would really appreciate if you can send me sample of condition which we can restrict with order quantity which is produced with 3 months of history of finished goods production. Thank you
    Regrads,
    Manju

  • How to Calculate last 12 months in webi?

    Hi,
    I am working on a webi report based on oracle. My report table does not have any month field in it. Hence, I created a derived table in the universe for 12 months. Now, in my report I need to calculate last 12 months data. The month and year value will be given by the user and from that date values will be displayed for previous 12 months on a chart.
    Any ideas how achieve this in webi?
    Regards,
    C Mira

    Hi,
    Generally you can get the user values using the UserResponse() function.
    Using this, you can do some basic transformation of the user values for month and year to create a "Year_month_user" variable - e.g. in the format YYYYMM or better yet - create a date variable!
    (using the ToDate() function)
    When this variable is created, you can create a similar variable "Year_month_unv" from the universe objects.
    Then apply a custom filter on your chart with the syntax
    =[Year_month_unv] Between([Year_month_user];RelativeDate([Year_month_user];-365))
    I hope this helps.
    Btw: my first forum post - Yes!
    Edited by: Simon Steiper on Jul 28, 2010 2:25 PM (added the RelativeDate to syntax)

  • FM to get the previous fiscal month

    Hi All,
    is ther any function module to calculate the previous fiscal month from the sy-datum.
    Tnhanks in Advanc
    Moderator message: date calculation questions = FAQ, please search before posting.
    locked by: Thomas Zloch on Sep 29, 2010 2:28 PM

    Hi,
    Use the FM: RP_CALC_DATE_IN_INTERVAL
    DATA:date1 TYPE sy-datum.
    START-OF-SELECTION.
      CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
        EXPORTING
          date      = sy-datum
          days      = '00'
          months    = '04'
          signum    = '-'
          years     = '00'
        IMPORTING
          calc_date = date1.
      WRITE date1.

  • Customer exit to calculate previous quarter based on user entry in 0PCALMON

    Hi,
      I have written a CMOD code to calculate previous quarter based on user entry in 0PCALMON (0CALMONTH).  That is if 09.2008 is entered for 0PCALMON, it should fetch the months 04.2008, 05.2008,06.2008.
    But unfortunately I am getting all years and all months.
    Could you please help me debug this code.
    Global Declaration :
           z_vcalmonth(2) TYPE n ,
           z_vcalyear(4) TYPE n.
    When 'YQV_LQ'.
    if i_step = 2.
    READ TABLE i_t_var_range WITH KEY
      vnam = '0PCALMON'
      iobjnm = '0CALMONTH'
      INTO l_s_var_range.
      if sy-subrc = 0.
            z_vcalmonth = l_s_var_range-low+4(2).
            z_vcalyear = l_s_var_range-low(4).
          IF ( z_vcalmonth >= 1 AND z_vcalmonth <= 3 ).
            z_vcalyear = z_vcalyear - 1.
            CONCATENATE z_vcalyear '10' INTO l_s_range-low.
            CONCATENATE z_vcalyear '12' INTO l_s_range-high.
          ENDIF.
          IF ( z_vcalmonth >= 4 AND z_vcalmonth <= 6 ).
            CONCATENATE z_vcalyear '01' INTO l_s_range-low.
            CONCATENATE z_vcalyear '03' INTO l_s_range-high.
          ENDIF.
          IF ( z_vcalmonth >= 7 AND z_vcalmonth <= 9 ).
            CONCATENATE z_vcalyear '04' INTO l_s_range-low.
            CONCATENATE z_vcalyear '06' INTO l_s_range-high.
          ENDIF.
          IF ( z_vcalmonth >= 10 AND z_vcalmonth <= 12 ).
            CONCATENATE z_vcalyear '07' INTO l_s_range-low.
            CONCATENATE z_vcalyear '09' INTO l_s_range-high.
          ENDIF.
          l_s_range-sign = 'I'.
          l_s_range-opt = 'BT'.
          APPEND l_s_range TO e_t_range.
    endif.
    endif.

    Hi,
    U can use the FM SLIM_GET_QUARTERLY_PERIODS
    Pass the variable first date of 0PCALMON ( 09.2009 => '01.09.2009') to get the table of all the 4 period ranges in PERIODS  table in result
    and read the Last entry to get the Previous Quarter period
    PERIODS table
    S OP LOW        HIGH      
    I BT 01.07.2008 30.09.2008
    I BT 01.10.2008 31.12.2008
    I BT 01.01.2009 31.03.2009
    I BT 01.04.2009 30.06.2009
    Then pass this values in l_s_range-low l_s_range-high
    Hope this helps
    Sonal...

  • How to get previous 2 months from current date in a dropdown?

    Hello Experts ,
                           In the application which I am developing, there is a requirement wherein , I want to Populate current month and previous two month in a drop down depending upon today's date. please help.
    Thanks & Regards,
    Pratbha Shukla

    The internal format for dates is yyyymmdd.  Therefore you can just grab the month value from the date:
    data lv_month type FCMNR.
    lv_month = lv_date+4(2).
    Just subtract from the month to get the two previous.
    data lv_previous1 type FCMNR.
    data lv_previous2 type FCMNR.
    if lv_month = 1.
    lv_previous1 = '12'.
    else.
    lv_previous1 - lv_month - 1.
    endif.
    if lv_previous1 = 1.
    lv_previous2 = '12'.
    else.
    lv_previous2 - lv_previous1 - 1.
    endif.
    Then do your lookup for the month name by reading the table returned from function module MONTH_NAMES_GET.

  • Financial Report to get data of previous 2 months

    Hi,
    I got a requirement to create a report to show the data of previous 2 months based on the prompted month and year. Suppose if user selects March and year as *2009* then my report should show data for Mar followed by Feb and Jan of *2009*. I am able to create that correctly for the current year if the prompted month is from March to December.
    But if user prompts Jan and Year as *2009* then I should retrieve the report of data*Jan* of *2009* followed by Dec and Nov of previous year that is *2008*. Similarly if user prompts Feb then my report should show the data of Jan of this year 2009 and Dec of *2008*. I have YEAR and PERIOD dimensions in the Column. Could anybody please help me how can I provide such functionality. Thanks in advance.
    Regards,
    Sravan

    Hi Sravan,
    Check the below thread...hope it will help you.
    Very Urgent FR Report
    Regards,
    Mars

  • Calculate previous Sunday from the current day

    Hi Gurus,
    Can anybody tell what is the name of the function module which caluclates the previous Sunday from the Current system date. or any other idea how to calculate previous sunday from the current system date in Query.
    Thanks
    Liza

    Hello,
    See my previous thread to you for a similar Re: Find out previous Monday based on 0CALDAY
    Thanks
    Chandran

  • How to calculate next 12 months

    Hi Gurus,
    If a user enters a date like : 15.05.2007, I need to calculate next 12 months values.
    i.e. low = 16.05.2007
         high= 15.05.2008.
    Any help greatly appreciated. Thanks.
    Best Regards,
    Reddy.

    data: l_month         type i,
            l_year          type i,
            l_sum_of_months type i.
    data : V_DATE TYPE  D,
             V_MONTHS TYPE  I DEFAULT 0,
             E_DATE TYPE  D.
        l_sum_of_months = v_date+4(2) + v_months.               "YREM981595
        l_month         = ( l_sum_of_months + 1 ) mod 12.       "YREM981595
        if l_month eq 0.
          l_month = 12.
        endif.
        l_year  = l_sum_of_months div 12.
        l_year  = l_year + v_date(4).
        if l_year gt 9999.
          e_date      = con_hidate.
        else.
          e_date+6(2) = '01'.
          e_date+4(2) = l_month.
          e_date(4)   = l_year.
          e_date      = e_date - 1.
        endif.
    rewards if useful,
    regards,
    nazeer

  • ICal has dropped a monthly event for the previous four months....... why did it disappear? and where is it?  It was the same event but a different day each month.

    iCal has dropped a monthly event for the previous four months....... why did it disappear? and where is it?  It was the same event but a different day each month.

      I installed this same digitizer in my T|X some weeks ago.  Some discussion of my experience may be found in this Usenet posting and subsequent thread.
      The stock digitizer in my T|X had always had some significant alignment issues (for which PowerDigi was able to compensate very nicely) and sensitivity which was uneven, but which usually required a heavier touch than I liked.
      Eventually, it began to develop a “dead spot” near the upper left.  My T|X was under warranty, so I probably ought to have sent it in to Palm to be repaired, but I wasn't willing to be without it for the required amount of time, and I've heard enough reports of other T|X owners getting unsatisfactory results this way.  I'd heard enough good reports about the PDAPARTS.COm digitizer, that I decided that the only acceptable way to repair my T|X would be to install one of those.
      After however many weeks it has been, I am still very pleased with the results.  It continues to work flawlessly; it is much more sensitive, so it doesn't require nearly so heavy a touch, and I very much like the hard feel that it has, compared to the spongier feel of the stock digitizer.
      My wife's T|X still has its stock digitizer, and it has so far not shown any of the same problems that mine did, or for which the T|X has become notorious, but the feel is noticeably inferior.  She's content with it the way it is, but I think that if I were to ever buy another T|X for myself, I wouldn't wait for the stock digitizer to fail.  The PDAPARTS.COM digitizer is simply superior in every imaginable way; and, in my opinion, a T|X with the PDAPARTS.COM digitizer installed is sufficiently superior to one with the stock digitizer (even if it isn't defective) to be very much worth the expense and trouble of installing it.
    Post relates to: Palm TX

  • Mdx expression to get previous period month

    My dimension table has a column for current period month, where every row has the same value, updated at the end of the month. I am using the following expression to get current period month.  "Jan - 2009" is randomly chosen, as every
    cell on that column will have the same value.
    [Time].[Time].[Month].[Jan - 2009].Properties( "Current Period" )
    Result of the above expression is "Feb - 2015".
    Current period month will always be previous month of the current year. example: During Jan - 2015, current period month is Dec - 2014.
    I need to use this expression or any function to get the previous month. For example if the  current period month is Feb - 2015, then the previous period month should give me Jan - 2015.
    How can I accomplish that?

    Hi 
    I have a similar situation but not with date dimesion we have sales seasons in retails domain.
    please check how I am handling this
    select (LinkMember ([ProductSeason].[Current Season].firstChild,
    [ProductSeason].[Season Name])).prevmember
    on columns,
    [Measures].[Total pcs]
    on rows
    from [NewCube]
    fsdfasdf
    Here I have column currect season which get update at the start of each season with currect season
    name. then I am receiving the season name member from product season dimension and fetching the previous member for that.
    Hope this will help.
    Regards,
    Rahul
    lntinfotech

Maybe you are looking for

  • Attachments open in same tab - i want them to open in a new tab

    I work in school recruiter (used for taking work applications for school system) and open a lot of attachments to applications. When I close the attachment, it closes me out of school recruiter. I need the attachments to open in a separate tab. Where

  • Intermittent clicking when recording guitar - not metronome

    I've recently upgraded to Snow Leopard and GB 09.  When I record my electric guitar, I'm hearing occasional clicking sounds which are also heard on the recording.  Not the metronome.  It's off.  I've lowered the input gain both in preferences and the

  • Most of my movie loads in frame 0

    Hello, I try to put a preloader on my movie but (according to "simulate preloading" most of the items loads on frame zero (yes 0) ... so the preloader appears only *after* most of it has been loaded. Is there a way to go around this. Explanation.: Th

  • Display format page by page

    hi In my program resultset contain more than 30 records. I want to display 20 records and first page contain 10 records and second page contain 10 records. The results should be shown in two pages with the index Page 1 of 1 or Page 1 of 2. Suppose If

  • ITunes library synchronisation across network

    Hi everyone I am setting up my new Macbook Pro. I have imported all of my music files to ~/Music and all my movies to ~/Movies. I changed the iTunes folder organisation to manually. So far so good. Now I have bought an Apple TV and this Apple TV is r