List rolling 13 months?

How can I use SQL to list the rolling 13 months as of today? For example, it's March 2006 right now, and so I want to list 03/01/2006, 02/01/2006, 01/01/2006, 12/01/2005, 11/01/2005, 10/01/2005, ..... 04/01/2005 & 03/01/2005 ? I tried many different ways, but could not figure it out. Thanks for any help.

Hello
This is one way of doing it:
SQL> SELECT
  2     ADD_MONTHS(TRUNC(sysdate, 'MM'), -rn)
  3  FROM
  4     (       SELECT
  5                     rownum - 1 rn
  6             FROM
  7                     dual
  8             CONNECT BY
  9                     rownum <= 13
10     )
11  /
ADD_MONTH
01-MAR-06
01-FEB-06
01-JAN-06
01-DEC-05
01-NOV-05
01-OCT-05
01-SEP-05
01-AUG-05
01-JUL-05
01-JUN-05
01-MAY-05
01-APR-05
01-MAR-05
13 rows selected.HTH
David

Similar Messages

  • Dynamically rolling months forward in Analyzer with HFM data source

    I'm building a dashboard in Analyzer 7.0. I want the reports to dynamically update each month so a user does not have to go in and change the month on each report. Normally I would use a sub variable (i.e. cur_month) however, the datasource is not Essbase, it's HFM.Anyone else using HFM as a data source and found a feesible way to roll months forward in Analyzer after the close? I looked at Personal variables, but that still leaves me with the same problem of someone having to go in and update each users personal variables.Suggestions are appreciated as well.Thanks,Gary CrisciSenior ConsultantPinnacle Group, [email protected]

    I came up with a working solution. Analyzer allows you to retreive member lists from HFM. I created a member list called 'Current Month' and assigned a single member to it. I then pull the report using the member list and get the current month view. Now the admin only has to update the meber list once a month when the close is finished and all reports will "Dynamically" roll forward.Regards,

  • Rolling month at repot level

    Is it possible to adding rolling 12 month at the report level? Does a formula need to be added or is there is an example I can see. I saw an example where the rolling months can be entered by the user but in this case th the # of monts need to be 12.
    Thank you

    suser,
    In the report add the below filter condition
    u can replace 6 with 12 incase of 12 months
    if u want to use max date available in database instead of current_Date ,create a rep variable which ll give u max(report_Date) use that in formula
    timestampdiff(slq...... , -12, valueof(rep_Var) and valueof(rep_var)
    http://img4.imageshack.us/img4/8607/filtersh.jpg

  • Need Help on List of Months between Two Dates

    Hello everyone,
    I have a table which has startdate & enddate, and need a SELECT statement to list all months between these two dates for each given ID.
    I did some test, and could not figure out how to get the startdate & enddate from testing table (instead of hard code them) in the select statement.
    Could anybody please help on it (Oracle 11gR2),
    Thanks in advance!!!
    create table testing(
    id          number,
    start_date  date,
    end_date    date);
    insert into testing values(100, to_date('05-FEB-2011', 'DD-MON-YYYY'), to_date('28-MAY-2011', 'DD-MON-YYYY'));
    insert into testing values(200, to_date('20-JUN-2011', 'DD-MON-YYYY'), to_date('28-DEC-2011', 'DD-MON-YYYY'));
    commit;
    select * from testing;
            ID START_DAT END_DATE
           100 05-FEB-11 28-MAY-11
           200 20-JUN-11 28-DEC-11
    Elapsed: 00:00:00.01
    *for testing.id = 100:*
    select to_char(add_months(to_date('05-FEB-2011', 'DD-MON-YYYY'), l - 1), 'YYYY-Mon') Dates
    from (select level l
           from dual
        connect by level <= months_between(trunc(to_date('28-MAY-2011', 'DD-MON-YYYY'), 'MONTH'),
                                           trunc(to_date('05-FEB-2011', 'DD-MON-YYYY'), 'MONTH')) + 1);
    DATES
    2011-Feb
    2011-Mar
    2011-Apr
    2011-May
    Elapsed: 00:00:00.01
    *for testing.id = 200:*
    select to_char(add_months(to_date('20-JUN-2011', 'DD-MON-YYYY'), l - 1), 'YYYY-Mon') Dates
    from (select level l
           from dual
        connect by level <= months_between(trunc(to_date('28-DEC-2011', 'DD-MON-YYYY'), 'MONTH'),
                                           trunc(to_date('20-JUN-2011', 'DD-MON-YYYY'), 'MONTH')) + 1);
    DATES
    2011-Jun
    2011-Jul
    2011-Aug
    2011-Sep
    2011-Oct
    2011-Nov
    2011-Dec
    7 rows selected.

    SQL> select * from testing
      2  /
            ID START_DAT END_DATE
           100 05-FEB-11 28-MAY-11
           200 20-JUN-11 28-DEC-11
    SQL> select  id,
      2          to_char(add_months(start_date,column_value - 1),'YYYY-Mon') dates
      3    from  testing,
      4          table(
      5                cast(
      6                     multiset(
      7                              select  level
      8                                from  dual
      9                                connect by add_months(trunc(start_date,'MM'),level - 1) <= end_date
    10                             )
    11                     as sys.OdciNumberList
    12                    )
    13               )
    14    order by id,
    15             column_value
    16  /
            ID DATES
           100 2011-Feb
           100 2011-Mar
           100 2011-Apr
           100 2011-May
           200 2011-Jun
           200 2011-Jul
           200 2011-Aug
           200 2011-Sep
           200 2011-Oct
           200 2011-Nov
           200 2011-Dec
    11 rows selected.
    SQL> SY.

  • Rolling months in HFR ---- Really Urgent

    Hi All,
    We are using HRF to generate Reports connecting to and Essbase Database 11.1.2 Versions,
    in HFR we need 12 rolling months as per user request,
    User will select one Period and he need previous 11 months information...
    I tried to Period -1 to Period -11 function period is changing fine but problem is with Year Dim.. how Year will change
    Here user may select DEC of current Year and he need information of previous 11 months which falls in previous year...
    How the Year will change this is Big Challenge we are facing ......
    It would be grate help..... we have to present to client by today EOD........
    Regards
    Vijay
    Edited by: SVK on Sep 6, 2010 2:02 PM

    one way to do this is to use point of view with the range function, using conditional suppression:
    so that you have:
    - prior year with month (from POV to Dec) hiding POV
    - current year with month (from Jan to POV)
    (assuming you run a Jan to Dec year in your month outline/financial calendar)

  • Rolling month for webi report using Univ based on BEX Query

    Dear Experts,
    I'm new to OLAP universes.
    We have a requirements of having last 12 months rolling  for given measure(Key figure) in webi report using Univ based on Bex Query.
    We require a calmonth (time dimension) object  (restricted for last 12 months) where user can drag and drop on column section of cross-tab table.  User should drag more than one Key figure ( for ex. sales rev and & qty sold) for each month
    Could you please provide me the solution to do this?
    Thanks
    Akshara

    Hi Henry,
    Thank  you for your response.
    BEx query has not been created yet. we need to create accordingly and require your help in creating the same.
    Regarding reporting requirements,  User wants to have adhoc reporting  with rolling months ( 12 months or 6 months) functionality. Users want to link any KF to this rolling months dimension.
    If we can't have this, what is the alternative that we can propose to user.
    Thanks
    Akshara.

  • Rolling Month in Billing Plan in Sales Order

    I Require rolling month billing dates in Sales Orders . Kindly help on the same the followng format is required.
    Contract Start Date : 05.01.2010
    Contract End Date : 31.03.2010
    Settlement From   Settlement to    Billing Date
    05.01.2010            04.02.2010     04.02.2010
    05.02.2010            04.03.2010     04.03.2010
    05.03.2010            31.03.2010     31.03.2010.
    If there are any user exits where i can make these changes or if there are any configurations that i  can change then suggest.
    Thanx in Advance.
    Dilip

    You have to enable the PERIODIC BILLING as the billing plan for your case.
    You can refer to the OSS note 831158 which gives lot of other OSS notes for you to configure the scenario.

  • List of months and years

    How i can get list of months and years from my tables(ex. tab1), when i have start date ex. 072003 and end date ex. 042005 . That i use in report 6i.. . .
    months | years| . . . . .
    ----------------------------------

    If i am not wrong you want these result
    SQL> SELECT hiredate FROM emp;
    HIREDATE
    17-DEC-80
    20-FEB-81
    22-FEB-81
    02-APR-81
    28-SEP-81
    01-MAY-81
    09-JUN-81
    19-APR-87
    17-NOV-81
    08-SEP-81
    23-MAY-87
    03-DEC-81
    03-DEC-81
    23-JAN-82
    14 rows selected.
    SQL> INSERT INTO emp (empno,hiredate,deptno) VALUES (1,SYSDATE,10);
    1 row created.
    SQL> COMMIT;
    Commit complete.
    SQL> SELECT hiredate FROM emp;
    HIREDATE
    17-DEC-80
    20-FEB-81
    22-FEB-81
    02-APR-81
    28-SEP-81
    01-MAY-81
    09-JUN-81
    19-APR-87
    17-NOV-81
    08-SEP-81
    23-MAY-87
    03-DEC-81
    03-DEC-81
    23-JAN-82
    01-SEP-06
    15 rows selected.
    SQL> SELECT TO_CHAR(a,'MON-YYYY') b FROM
      2  (SELECT ADD_MONTHS(TRUNC(sysdate,'YYYY'),(rn.r-1)) a FROM
      3  (SELECT ROWNUM r FROM user_objects WHERE ROWNUM<=12) rn)
      4  MINUS
      5  SELECT TO_CHAR(hiredate,'MON-YYYY') FROM emp;
    B
    APR-2006
    AUG-2006
    DEC-2006
    FEB-2006
    JAN-2006
    JUL-2006
    JUN-2006
    MAR-2006
    MAY-2006
    NOV-2006
    OCT-2006
    11 rows selected.
    SQL> SELECT b FROM
      2  (SELECT TO_CHAR(a,'MON-YYYY') b FROM
      3  (SELECT ADD_MONTHS(TRUNC(sysdate,'YYYY'),(rn.r-1)) a FROM
      4  (SELECT ROWNUM r FROM user_objects WHERE ROWNUM<=12) rn)
      5  MINUS
      6  SELECT TO_CHAR(hiredate,'MON-YYYY') FROM emp)
      7  WHERE b BETWEEN 'NOV-2006' AND 'SEP-2006';
    B
    NOV-2006
    OCT-2006
    SQL> Khurram

  • Team calendar - rolling month

    Hi all
    Just wondering if anyone has found a way to have the team calendar show a rolling month i.e. rather than a static month (1 - 31), show 15 days prior to todays date and 15 days after todays date.
    Our managers get annoyed towards the end of the month as they have to continuously change between the current and next month in order to see if people are at work (we run a fortnightly payroll, not monthly).
    Any feedback would be appreciated.
    PS

    Nachy,
    All of these have start dates in 2009, whereas, we can't see data for previous months in 2010. I believe the relationship I mentioned in the initial post is responsible, even though there are enteries before it that are ignored.
    We just discovered this and we are live. (i.e. this is production environment) Your prompt replies will be highly appreciated.
    Regards,
    Motaz

  • Single work order to release 2 operation from Task list 1 month and 6 month

    Hello,
    We have a maintenance plan for an equipment. It has a task list with 2 operation: Operation 0010 is 1 month interval and Operation 0020 is 6 month intervals.
    Currently when the preventive maintenance plan is release, 2 work order are created for every 6 months.
    Is it possible to combine the One month interval and 6 month interval task to a single Work Order?
    Thanks.

    For 1 month freq, orders will be created every month. In 6th month, order will be created with one month & 6th month operation together.
    If you want to suppress one month operation while order is getting created with 6th month operation, mention higher hierarchy for 6 month freq in strategy. This means, mention hierarchy 1 for 1 month freq & 2 for 6 months freq. While both the operations are due, operation with higher hierarchy only will be taken over to the order.
    I guess, this what you expect. Please confirm.

  • Rolling months - Time series function

    Hi,
    I am new to OBIEE and this forum, and wondering someone could guide me through this requirement.
    I have a requirement that User needs to see inventory for rolling past 13 months, and should display inventory numbers(snapshot) for the first day of the month.
    Date     Inventory $
    1-Jan-12     46652
    1-Feb-12     25145
    1-Mar-12     78542
    1-Apr-12     45215
    1-May-12     24156
    1-Jun-12     98541
    1-Jul-12     21478
    1-Aug-12     25144
    1-Sep-12     26545
    1-Oct-12     48855
    1-Nov-12     45698
    1-Dec-12     12546
    1-Jan-13     26586
    How can I get past rolling 13 months in OBIEE? I have a variable created for "Rolling 13 months" and "First Day of month", but I guess they are not working when combined. Please advise.
    Thanks,
    P

    If I understand correctly, I'd put a filter on the Date column using the Timestampadd function available in OBIEE. Something like:
    "Table"."Date">= Timestampadd(SQL_TSI_MONTH, -13, MONTH("Table"."Date")
    Let me know if this is not what you were looking for.
    Please award points if helpful/correct.

  • Rolling Months

    I created 12 rolling session variables to use to get 12 month rolling sums for my report. After creating the variables i made this filter to get sums for my GL balances (12 months ending).
    FILTER ("Facts - GL Balance"."Balance Amount") USING ("Time"."Fiscal Period End Date" BETWEEN VALUEOF(NQ_SESSION.PERIOD_START_11AGO) and VALUEOF(NQ_SESSION.PERIOD_END_00))
    this filter works only for 12 periods from the current date (NQ_SESSION.PERIOD_END_00) - how can I expand my range to include all the fiscal periods from 2002 to 2011, right now the report only gives me 12 periods from 10/31/2011 to 11/30/2010... for some reason my filter is limiting me, how can i circumvent this.... any help wld be apprceiated!!!!

    Thank you Deepak, you guided me correctly it is working for my 12/31 end of month dates bcoz it is rolling summed months from january. All other dates when selected from droplist are a sum from jan and not 12 months ago, i did all teh steps how can i now make the data correct- thanks
    Edited by: 846431 on Nov 2, 2011 9:21 AM

  • List of Monthly Overall Released PR

    Hi,
    I want to generate a list of over all released ( Authorized by Highest Authority )  PR for a particular Month. Is there a Standard Report Available ?
    Please give your expert views.
    Regards
    Shyam Kogta
    09871894536

    Dear Shyam,
    Standard report ME5A has the selection option as Release date, but this is not the actual release date.
    This date is only statistical date by which PO should be initiated.
    To have a report based on actual release date you have to develop the zreport.
    Manoj

  • Rolling Month Sum required

    Hi ,
    I like to achieve a functionality using the RSUM or Timeseries function but any of this would not help .
    I have a report to show the sales for last 12 months in such a way that each month of that 12 months will show the sum up all sales for past 11 months + that month .
    My requirement is that standing on Month - Apr2009 I like to see the sales value sum from May2008 to Apr2009 ,whereas standing on May 2009 I would like to see the sum of sales for each month from June 2008 to May2009 (where each month sales is not rolling sum rather individual month total sales).While I am using TODATE function in OBIEE 10.1.3.4 version it is showing the sum from Jan 2009 to Apr2009 (like Month to date) but my intension is to show the aggregated value in single dervied column using any of the analytic function to calculate the past 11 months aggregated value + that months sales to be represent in a single metrics.
    The difficulty of achieving this by using MSUM is that it works on number of row to be displayed in report .Since I have a filter on date range from current date to currentdate-365 to show the relevant month in this range and to calculate the sum on basis of that.So using MSUM(Sales,12) for first month is not aggregating with past 11 months sales rather only showing that month sales data which is wrong .
    Any response to achieve this functionality would be helpful for us .
    Thanks in advance,
    D

    create an alias of the fact table in the physical layer
    join factalias to timedim in physical layer using complex join as
    TIMESTAMPADD( SQL_TSI_MONTH , -(12), Time.date) < fact.date and Time.date >= fact.date
    bring this aliasfact table table to logical layer in the same subject area, join to time dim (and othe dims) using a complex join.
    create necessary measures , such as 12monthsales
    move new table to presentation layer
    use this new 12monthsales columns in report
    so when you use time, it wont cut you off at the first month, but will go 12 month back for each month.
    hope this helps

  • Rolling months display

    Hi All,
    My requirement is such that the charts and cross tabs should display rolling 13 months from the selected month in the dropdown.
    My dropdown code at startup is:
    DROPDOWN_1.setItems(DS_1.getMemberList("0CALMONTH",MemberPresentation.Text,MemberDisplay.Key,13));
    DROPDOWN_1.setSelectedValue(DS_1.getVariableValueExt("ZE_CALMON"));
    On select code of dropdown is:
    DS_1.setFilter("0CALMONTH",DROPDOWN_1.getSelectedValue());
    But am not getting the rolling 13 months on selecting a calendar month in dropdown. Charts show data only for that particular date selected.
    Please can you let me know what should be the solution.
    Thanks & Regards
    Swasti

    Hi Fazith,
    The solution for Dropdown is not working for Dimension Filter as the method setSelectedValue is not present for filters.
    I tried the code:
    APPLICATION.setVariableValue("ZE_CALMON",DS_ALL_MAIN.getFilterText("0CALMONTH")) in the On Apply event for the filter. But am getting the error "The application does not exist" when a value is selected in filter.
    Am assuming that the query is not able to resolve at the first instance? Any idea on where it is going wrong or how it can be resolved?
    Many Thanks in advance
    Swasti

Maybe you are looking for