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)

Similar Messages

  • Calculate last 5 months

    How to calculate last 5 months from sysdate ?
    The statement - SELECT TO_CHAR(SYSDATE,'YYYYMM')-1 FROM DUAL gives 201300. The desired output is 201212, 201211, 201210, 201209, 201208.
    Sanjay

    Try this
    select to_char(add_months(sysdate, -1), 'YYYYMM') from dual
    union
    select to_char(add_months(sysdate, -2), 'YYYYMM') from dual
    union
    select to_char(add_months(sysdate, -3), 'YYYYMM') from dual
    union
    select to_char(add_months(sysdate, -4), 'YYYYMM') from dual
    union
    select to_char(add_months(sysdate, -5), 'YYYYMM') from dual

  • How to calculate Last year in BEx Report

    Hi Experts
    I have a requirement to create report in BEx --> report output will be Amount, Diff in percentage(Plan-Actual),Last year
    My question how we calculate the Last year and actual minus plan difference in percentage

    Hi,
    Make use of % functions in query designer to get the desired result.Please search on forum lot of examples will be there.
    Hope it helps.
    Regards,
    AL
    Edited by: AL1112 on Mar 7, 2011 4:56 PM

  • How to get last 5 monthly gross salaries of a particular employee

    hi,
    i have a requirement where i need to get the last 5 monthly gross salaries of a particular employee. how can i get the same . please help me on this.
    Regards,
    Shiva.

    Hi Shiva,
    First you shall call the function CU_READ_RGDIR.
    then with the seqnr field of rgdir table, call PYXX_READ_PAYROLL_RESULT
    In the result-inter-rt table get betrg field with the lgart eq '/101'.
    Regards,
    Dilek

  • Calculate Last 12 months Sales

    Hi Experts,
    I need to have MAT value in Reporting.
    MAT Value = Last 12 Months Sales Value/12.
    How can i achieve this.
    Please suggest the best way to have MAT value.
    Thanks in advance,
    Rafi

    Hi,
    Create one restricted key fig by offsetting month for last 12 months and drag sales value key fig into that.
    Now create a formula variable by dividing the newly created restricted key fig with 12.
    hope it helps...
    regards,
    Raju

  • How to get last 3 months on basis of sysdate in prompt

    Hi,
    I am using Fiscal Month in the prompts and the data in the column looks like below
    201201
    201202
    201203
    201204
    User will select the prompts between months period, like below
    Between 201201 and 201204.
    My requirement is, I need to default this Fiscal month value to last 3 months, Since we are in February, it should look like this.
    Between 201211 and 201301 (which is last 3 months)
    Rgds,
    Ma

    That should be something like
    SELECT MONTH FROM "Service - CRM Service Requests" WHERE Time.Date BETWEEN TIMESTAMPADD(SQL_TSI_MONTH,-3, current_date) AND TIMESTAMPADD(SQL_TSI_MONTH,-1, current_date) ORDER BY saw_0
    So in each filed you have to put
    TIMESTAMPADD(SQL_TSI_MONTH,-3, current_date)
    TIMESTAMPADD(SQL_TSI_MONTH,-1, current_date)
    Hope this helps, update back
    Edited by: Srini VEERAVALLI on Feb 20, 2013 12:37 PM

  • How to Show last 6 months?

    Hi Guys,
    I have a report that must show the last 6 months.
    If you open the report let's say on the 02.02.2010, this report must have the following columns and the following order:
    Jan 2010 - Dec 2009 - Nov 2009 - Oct 2009 - Sep 2009 - Aug 2009.
    Is it possible to create a variable that can accomodate this request to show last six months dates whenever the report is run?
    regards,
    BW.

    create a date object in universe to get the date in required format and create filter on universe side to filter data for last six month from current date.
    e.g. filter
    date1 between current_date and add_months(current_date,-6)
    --kuldeep

  • 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

  • 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

  • How to calculate last week of the month

    i want calculate dollar on the basis of last week of the month.

    Hi prashant,
    try to filter with the required month. if this is not your question, explain little bit clear..so, that some one will help you if they have the solution with.
    or do you want to create a variable and then filter prompts...
    cheers...
    Edited by: ManiEswar on 24-Jan-2011 12:59

  • How to Calculate number of months between two dates

    Hi All,
       In one of the fomr developments, I have to calculate the
    Number of Days
    Number of Months ( Considering Leap Year) provided by the dates, end user enters in the form,
    After going thorugh some forum discussion, I have come to know about so many things which were not clear till now.
    I have gone through various forums too,  some one suggets to make use of FORM CALC and some other JAVA SCRIPT. But the logic i want to build in java script.
    The most interesting point is the DATE object is not getting created when i write  the below code
      var startDate = new DATE(oYear, oMonth, oDay);
    I am still not clear, that really the date object gets created in Adobe form If so the why the alert box is getting populated when i write below lines
    var oTemp = startDate.getFullYear();
    xfa.host.messagebox(oTemp);
    So, there are so many unclear things,
    If any one can help me by suggesting the approach and how to build the logic in the JavaScript I would be really thankful
    Regards
    PavanChand

    Hi,
    ChakravarthyDBA wrote:
    Hi
    I want number of Sundays between two dates
    example
    number of Sundays count between '01-04-2013' and '30-04-2013' in one select query I have to include this as sub query in my select statement.Here's one way:
    SELECT       early_date
    ,       late_date
    ,       ( TRUNC (late_date + 1, 'IW')
           - TRUNC (early_date,        'IW')
           ) / 7       AS sundays
    FROM       table_x
    ;This does not depend on your NLS settings.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only), and also post the results you want from that data.
    Point out where the statment above is getting the wrong results, and explain, using specific examples, how you get the right results from the given data in those places.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the forum FAQ {message:id=9360002}

  • How to calculate year and month

    Dear Friends
    I have to make a customised report.In this report there are different buckets of one year from the year and month being entered by the user.
    For example if user is giving input value for year and month as 200912 then system has to show data in first bucket for the period 200912 to 200901.In the second bucket system will show data for period 200812 to 200801.In this way system has to show data in 11 buckets for 11 years.
    Is there any function module/BAPI in SAP through which system will calculate period of one year for different buckets for my report from the input value(year and month) being given by the user.
    Moderator message - Please see The specified item was not found. before posting - post locked and Points unassigned
    Edited by: Rob Burbank on Jan 5, 2010 11:03 AM

    Hi Satish,
    You can do this with a Standard function module.
    I am providing my code below :
    data : G_date type sy-datum.
    CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
        EXPORTING
          DATE      = sy-datum " instead of sy-datum provide
              " the select option here which user provides.
          DAYS      = C_fourty"45
          MONTHS    = C_MM    "00
          SIGNUM    = C_Negative "'-'
          YEARS     = C_YY    "00
        IMPORTING
          CALC_DATE = G_date. "G_date will have date less than 45 days
    *                         " from the day program has been executed.
    Now based upon the G_DATE, we can fetch remaining 10 buckets.
    Regards,
    Kittu
    Edited by: Rob Burbank on Jan 5, 2010 11:01 AM

  • How to calculate a week & Month in given date range (not for sele-options)

    Hi ,
      I have defined 2 date parameters in sel-screen (Plz remember that date variable are not a SELECT-OPTIONS).  Now i want ot display week nos & monts in output.
          Ex: date1: 20080101 & date2: 20080229. then
                    weeks : 1, 2, 3,---9.
                    months: jan-08, feb-08.
    Plz help me with block of code or any FM.
    Regards,

    Hi Srikanth,
            The FM HR_99S_INTERVAL_BETWEEN_DATES   is doesn't existing, but there is a fm HR_MX_INTERVAL_BETWEEN_DATES but it returns no of Years & Days.
           But i found some FM which r returns no of months for given date range. but my requirement is, want to display the month no bw 1 to 12. (ex: dat1=15-03-2008 & dat2= 01-06-2008 then in month fields 03,04,05 & 06. ).
    Plz help me on this.
    -Regards.

  • 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

  • Last four Months Background job details to view

    Hello ,
    How to find Last four months (or last year) Background job details , as i need to schedule one job which was deleted from system and the same was executed 3 months agao, so i want to run the same job now( I do not know the steps to given for this job to shcedule again).
    <<removed_by_moderator>>
    Thanks,
    Chinna
    Edited by: Vijay Babu Dudla on Apr 28, 2009 5:40 AM

    > Please do the needful asap
    I thought this was extinct by now.
    If the job was reorganized i.e. deleted, you'll have to do the needful and reschedule it from scratch. If you don't know the steps any more, bad luck I'm afraid.
    Thomas

Maybe you are looking for

  • Getting the required property of an item in a bean

    Hello all, is it possible to get the required property of e.g. a VTextField inside a PJC? I am trying to write a bean that iterates through all the components of a form a puts a red border on all fields marked as required in Forms. I cannot find an a

  • Inserted value too long ...

    Hi, I tried to migrate a VARCHAR2 (2000) column into an other VARCHAR2 (2000) column in an other database. I get the error message "Inserted value too long ..." length (source) = 1998 The target database has a Unicode character set. Could you help me

  • Random file name for xml output

    Hi: You know how when you're in design mode and select PDF preview, then click an email submit XML data button it assigns a random number as the XML file name? How can I set that same thing up when a user clicks the submit button from the web site? T

  • How can i use Progress bar in IR Report

    Hi , I have created IR Report based on the View so, it's been taking 10-15 mins of time to execute the IR Report. Here user want to see the Progress bar while executing the IR Report. How can i use Progress bar in IR Report. Anybody have idea on Prog

  • IDOC in LSMW

    Hey all, I'm working on lSMW using IDOC processing and BAPI. Iam encountering problems in the partner function.Can anybody guide as to how to go about the entire process of LSMW.If anyone have a suitable document or article for the same kindly post i