Last three month data

Hi,
Requirement:
Want to show last three months data dynamicaly based month value seleted in prompt. ex: When Septemper is selected report should show, Sep, Aug, Jul
tried using ago function but i want to use three measure columns. So is there way using single measure column and achieving.
Thanks,
Satheesh

Satheesh Kumar  wrote:
Hi,
Requirement:
Want to show last three months data dynamicaly based month value seleted in prompt. ex: When Septemper is selected report should show, Sep, Aug, Jul
tried using ago function but i want to use three measure columns. So is there way using single measure column and achieving.
Thanks,
SatheeshSatheesh, I have a question for you. It is the same as the comment left on the article in the link that @user gave you. Like that link -- which doesn't work for all scenarios, how are you accounting for say the month of January? Without a "year" included, you cannot always "subtract 3" to get "3 months ago." Does "month" always correspond to the current year?
Finally, what are the values of the column the filter is to be applied? All these are important to know if you want help on this. Try again. Thanks.

Similar Messages

  • Variable Exit - Last Three months date range based on Sy-datum

    Hi
    I have a requirement to filter last 3months data based on sy-datum. I have a variable filter on Posting Date.
    For e.g. Today is 20110622
    I have to determine below range: When users run the report prompt should be auto filled with below date range.
    From Value: 20110301
    To Value     : 20110531
    From sy-datum I can find the first day of the current month - In this scenario 20110601 (I'll replace last 2 characters with "01").
    If I subtract "-1" I'll get the To Value: 20110531
    Question is to get the "From Value". If I subtract 90days from To value, it will work for few months.
    For e.g. If my To value is Feb 28th and if I subtract 90days, I may get a different answer.
    Is there any better approach to determine this date range?
    Thanks for your help.
    Best Regards,
    Sree

    Hi Sree,
      Pleae find this approach and compare
    data : l_date type sy-datum,
    l_startdate type sy-datum,
    l_endate type sy-datum,
    l_startmonth(6) type c,
    l_endmonth(6) type c,
    l_date = sy-datum.   say "20110622
    l_endmonth = sydatum(6)   "201106
    Pass year month and get previous month using this standard .
              CALL METHOD cl_rs_time_service=>shift_year_month
                EXPORTING
                  i_year_month = l_endmonth
                  i_shift      =  -1
                RECEIVING
                  r_year_month = l_endmonth
                EXCEPTIONS
                  failed       = 1
                  OTHERS       = 2.
    "l_endmonth = 201105.
              CALL METHOD cl_rs_time_service=>shift_year_month
                EXPORTING
                  i_year_month = l_endmonth
                  i_shift      =  -2
                RECEIVING
                  r_year_month = l_startmonth
                EXCEPTIONS
                  failed       = 1
                  OTHERS       = 2.
    "l_startmonth = 201103
    l_startdate(6) = l_startmonth.
    l_startdate+6(2) = '01'.
    "l_startdate = 20110301
    We got startdate in and we want to get enddate , but we got endmonth ...
    now we need to get last date of the endmonth.
    Use this function module SLS_MISC_GET_LAST_DAY_OF_MONTH  and u can get it. Input should be date.
    so put l_enddate+6(2) = '01'.
    l_enddate(6) = l_endmonth.
    now pass end date to the  Function module and this will return the end date of the month.
    So you get l_startdate and l_enddate as you require. This will work for leap years or feb 28 days what ever...
    Regards
    vamsi
    Edited by: vamsi talluri on Jun 22, 2011 10:06 PM

  • Creation of a Query to show the values for the current month and the last 12 months data.

    Dear All,
    Good day!
    I have to create a Query with the below requirement.
    I have to create a Query to show the values for the current month and the last 12 months data.
    Can you please guide me how to achieve this ??
    thank you,
    Regards,
    Hema

    Hema
    explain the exact problem..? as you mentioned you want to create query to show values for current month and last 12 months.. so I think you want to show values for 12 months from current data.. you can achive this by multiple way..
    you can have selection screen and field with date .. and restrict based on system current date and 12 months before or you can handle this at your target.. .. I mean there are multiple ways to restrict data by date range..
    for some more hints..
    http://www.forumtopics.com/busobj/viewtopic.php?t=34393&sid=7fba465d0463bf7ff5ec46c128754ed6
    http://businessintelligence.ittoolbox.com/groups/technical-functional/cognos8-l/how-to-display-last-12-months-in-report-based-on-todays-date-3231850
    http://scn.sap.com/thread/3217381
    search on SDN you will get many other ways..
    Thanks,
    Bhupesh

  • Hi loading last 2 months data using abap routine

    we are planning to write a routine in infopackage level,
    using the option 6-ABAP routine, to select the last 2 month data ,
    we have the time characteristics 0CALMONTH, At present we managing the load by manually changing the selection for last 2 month every time ,
    It would be a great help if anybody can show a sample code to select last 2 month data,
    Thanks,

    Hi,
    data: l_idx like sy-tabix.
    DATA: lv_calmonth LIKE /BI0/SCALMONTH-CALMONTH.
    DATA: lv_day TYPE DATS.
    "previous month
    lv_day = SY-DATUM.
    lv_day+6(2) = '01'.
    lv_day = lv_day - 1.
    lv_calmonth = lv_day(6).
    READ TABLE l_t_range with key fieldname = 'CALMONTH'.
    l_idx = sy-tabix.
    MOVE lv_calmonth TO l_t_range-low.
    MODIFY l_t_range INDEX l_idx.
    "previous month - 1
    lv_day+6(2) = '01'.
    lv_day = lv_day - 1.
    lv_calmonth = lv_day(6).
    MOVE lv_calmonth TO l_t_range-low.
    APPEND l_t_range.
    p_subrc = 0.
    let me know if this works.... not sure about the last append.
    Olivier.

  • How to get last 24 months data (if user not enter any kind of information)

    Hi all,
    I am want a report such that
    1. if user does not enter months he has to get last 24 months data(from current month)
    eg1.
    Sales
    currentmonth     300
    currentmonth-1  400
    currentmonth-20 500
    2. if user  enter months he has to get required months data(from current month)
    eg1.assume that user entered the interval of last two months.
    Sales
    currentmonth     300
    currentmonth-1  400.
    friends please me in desinging this query.
    It's very urgent,waiting for responses.
    Thanks,
    James.

    Hi james,
    1. if user does not enter months he has to get last 24 months data(from current month)
    ANS: U have to create variable Of  Currentmonth with The following
             Process Type: SAP Exit
             Variable Represent: Single value
            Variable Entry: Optional
    Check chekboxes for <b>Ready for Input</b> & Can be change in Query navigation.
    b) After this u have to give offsets by restricting this variable
    2. if user enter months he has to get required months data(from current month)
    ANS:
    For this U have to use Process Type: User-exit( User Entry)
    & After that specify the offsets by restriction.
    Thanks,
    kiran.
    Message was edited by:
            kiran manyam

  • Showing last n months data based on prompt

    Hi,
    I have a "reporting month" prompt like Mar'13 .The report should return last 12 months data for all the measures based on "Reporting Month" prompt and my result will look like below:
    Measures  Mar' 13 Feb 13 Jan 13 ....
    CORP        1345     1444     1555
    ERP           675       877       5678
    I have used a pivot view to get the table view like this but i am not sure how to use the logic for showing all Months .Kindly suggest.

    Hi,
    You can achive this at answers level with the help of presentation variable using "Last N months(Rolling months) data By year-month prompt in OBIEE".
    pl follow the below post.
    http://shivabizint.wordpress.com/2008/09/19/rolling-months-data-for-year-month-prompt-in-obiee/
    thanks

  • How do I retrieve the last three months of diary info stored on my iPad, it has mysteriously dissappearedplease?

    How do I retrieve the last three months diary stuff as my iPad appears to have wiped the info off please help.

    Check Settings > Mail, Contacts, Calendars > [scroll way down to] Sync Events ...
    Set the time period as you wish.

  • How to display three months data in ALV grid control

    Hi
    Thanks for all.I have tried now it is working but as per requirement month name and cumulative total will display like this format.cumulative total means month1amount+ month2amount+month3amount.And one more thing month range will change some times means sometimes i will give January date to march date and sometimes i will give July date to October date. but date range is same means between dates range is three months.
    please tell me how to display.
    GAS PRESSURE WELDING COST EFFECTIVENESS                                        Dec-11                         Cummulativetotal
    Sr. No             Item             Unit           Rate          Qty           Amount             
    GAS PRESSURE WELDING COST EFFECTIVENESS                                      Jan-12
    Sr. No             Item             Unit           Rate          Qty           Amount             
    GAS PRESSURE WELDING COST EFFECTIVENESS                                     Feb-12
    Sr. No             Item             Unit           Rate          Qty           Amount             
    Thanks & Regards,
    Vasu.
    Moderator message: only one thread per issue, please.
    Edited by: Thomas Zloch on Feb 20, 2012

    Hi
    Thanks for all.I have tried now it is working but as per requirement month name and cumulative total will display like this format.cumulative total means month1amount+ month2amount+month3amount.And one more thing month range will change some times means sometimes i will give January date to march date and sometimes i will give July date to October date. but date range is same means between dates range is three months.
    please tell me how to display.
    GAS PRESSURE WELDING COST EFFECTIVENESS                                        Dec-11                         Cummulativetotal
    Sr. No             Item             Unit           Rate          Qty           Amount             
    GAS PRESSURE WELDING COST EFFECTIVENESS                                      Jan-12
    Sr. No             Item             Unit           Rate          Qty           Amount             
    GAS PRESSURE WELDING COST EFFECTIVENESS                                     Feb-12
    Sr. No             Item             Unit           Rate          Qty           Amount             
    Thanks & Regards,
    Vasu.
    Moderator message: only one thread per issue, please.
    Edited by: Thomas Zloch on Feb 20, 2012

  • I have purchased an IMac in the last three months. Three days ago it started and will not let me open photo images on CDs. Says I do not have permission to view files.

    I have purchased an IMac three months ago. A few days ago when I tried to view photo images on CD an error message said I do not have permission to view the files. Have not been able to view any photo images or text files on CDs since: Again says do not have permission to view.

    Mount one of the CD/Right Click:Get Info/Sharing & Permissions. If the the CD is a CD-R, they should look something like this:

  • Display last 12 months data in column chart

    Hi All,
    I have one  dashbord  requirement in list box i have (example:):  "oct-11" i need to display previous 12 mnth data in column chart anybody help in excel formula how to display last 12 mnths based on list box selection.
    example:  if i select oct-11 from list box i need to display in chart like
    nov-10 dec-10 nov-10...................................oct-11
    please provide how to write in logic in excel

    Hi Shankar,
    Try this formula in excel : DATE(YEAR(A1),MONTH(A1)-1,DAY(A1))
    A1 will be your cell which is the destination of your List box. & then drag it till 12 months.
    If you are not having day from your list box then manually enter 1 in any cell and map that cell in place of A1 for day.
    HTH.
    Neeraj..

  • To get Current,Last, Next months data for Efashion report

    To Create a report with the user input prompt on Year and Month:
    If user select year as 2005 and month as 2 (Feb), revenue should be displayed for previous Month (Jan) and next month (March) of selected year.
    Sample output should looks as below.
    Year : 2005
    State
    Prev Month - Jan
    Current Month - Feb
    Next Month - Mar
    AAA
    $100
    $100
    $600
    BBB
    $200
    $400
    $200
    CCC
    $300
    $300
    $300
    I have created dimensions in universe premonth=(@Select(Time period\Month) -1) & Nextmonth=@Select(Time period\Month) +1) & taken 3 dataproviders from efashion universe .these are not working for year ends

    Hi
    solution found, taken 3 data providers & added below filters for 2 &3 data providers
    DP2
    @Select(Time period\Year)=iif(@Prompt('Enter Month','N','Time period\Month',,)=12,@Prompt('Enter Year','A','Time period\Year',,)+1,@Prompt('Enter Year','A','Time period\Year',,))
    @Select(Time period\Month)=iif(@Prompt('Enter Month','N','Time period\Month',,)=12,1,@Prompt('Enter Month','N','Time period\Month',,)+1)
    DP3
    @Select(Time period\Year)=iif(@Prompt('Enter Month','N','Time period\Month',,)=1,@Prompt('Enter Year','A','Time period\Year',,)-1,@Prompt('Enter Year','A','Time period\Year',,))
    @Select(Time period\Month)=iif(@Prompt('Enter Month','N','Time period\Month',,)=1,12,@Prompt('Enter Month','N','Time period\Month',,)-1)
    Thanks

  • How to find the number of users log into ESS for last three months

    Hi Team
    Is there any transaction / Report to find the number of users logged into the ESS and used the payslip tab. Is this possible to find?
    Waiting for hopeful replies.
    Regards
    Bhaskar

    Bhaskar,
    you can use google analytics,
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/50b94044-7008-2b10-1680-c04e4526367b
    jo

  • I already deauthorized all devices in the last three months but ...

    ..I need to deauthorize all again in order to reauthorize my newly fixed computer. After getting a new hard drive, the itunes store says that I have five users already. THis makes me believe that the itunes on my old hard drive is counting as the fifth computer.

    Deauthorize your computer individually even if it says it isn't authorized.
    (73748)

  • I need date that is three months prior to current date or sy-datum

    Hi All,
            Please help me in this issue.
    In the selection screen the lower limit of the select option should be last three months and on high it should be the sy-datum for ex
    30.06.2007                   30.09.2007  
    thanks in advance
    thanks & regards
    Kreddy

    Hi,
    you got the date
    now subtract 3 from the month
    and use this fm this will give the last day of the particular month
    for eg
    current month      required
    3                            12  and -1 for year
    4                            1
    5                             2
    like this
    for
    2                    11 -1 for year
    1                     10 and -1 for year
    then use it
        CALL FUNCTION 'RP_LAST_DAY_OF_MONTHS'
          EXPORTING
            DAY_IN            = R_FDATE-HIGH
          IMPORTING
            LAST_DAY_OF_MONTH = G_LTDT
          EXCEPTIONS
            DAY_IN_NO_DATE    = 1
            OTHERS            = 2.
        IF SY-SUBRC <> 0.
          MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
    regards,
    Venkatesh

  • Last/latest 10 months data ( including current month)

    Hi,  
    I need to find the last/latest 10 months data ( including current month)
    Year
    1/1/2014
    1/2/2014
    1/3/2014
    1/4/2014
    1/5/2014
    1/6/2014
    1/7/2014
    1/8/2014
    1/9/2014
    1/10/2014
    1/11/2014
    1/12/2014
    1/1/2013
    1/2/2013
    1/3/2012
    1/4/2012

    Hi,
    this is my data 
    Year column with Nvarchar datatype. 
    Year
    1/1/2014
    1/2/2014
    1/3/2014
    1/4/2014
    1/5/2014
    1/6/2014
    1/7/2014
    1/8/2014
    1/9/2014
    1/10/2014
    1/11/2014
    1/12/2014
    1/1/2013
    1/2/2013
    1/3/2012
    1/4/2012
    now form this yea) column i need to fetch the latest/last 10 months data only .
    OutpUt for the Query to be:
    Year
    1/3/2014
    1/4/2014
    1/5/2014
    1/6/2014
    1/7/2014
    1/8/2014
    1/9/2014
    1/10/2014
    1/11/2014
    1/12/2014
    Hope this will give you clear picture

Maybe you are looking for

  • SQL INDEX USAGE

    hi, I have a procedure which took 15-20 minutes in the past to execute.Suddently it is taking 2 hours.When i examined i came to know that the sql statement is not using one of the index.I dropped the index and created it.The explain plan is generated

  • What i need to filter unwanted sites?

    Hi All. My knowledge is very basic in terms of firewall security but i have learnt so much in CCNA network fundamental, routing protocols and concepts, switching and wireless. Still have to do wan technologies. What i need to ask from the community i

  • Safari upload issues

    Issues with uploading pictures with Safari, recently on both our computers PC we have had issues with Safari uploading pictures let's say to facebook, yet tried with internet explorer and it worked.  I can select the photo but then it does nothing, o

  • Log and transfer does not recognize footage. Please Help

    When i open the log and transfer window in FCP on my macbook it no longer recognizes the files from the Contents folder of a P2 card or the RED ONE files from the folder on my hard drive. last week however, everything was working fine. does this have

  • Need help freeing up space

    I recently purchased time capsule as I need to free up space on my disc. I connected it as the instructions says. I have backed my information up but just recently I tried using Photoshop and a message came up saying I didnt have enough disc space. I