Missing date range in select

Hello,
Database Version 10gr2(10.2.0.5)
This following data set is from my query, which the date range is weekly, where two week's date is missing (that's correct, because no data for those weeks). But I need to include that week date aslso with null or 0 values on. How to I select the running weeks from the following
Current data set
col1     week_date
4     04/14/2012
6     04/21/2012
5     05/12/2012
10     05/19/2012
2     05/26/2012
Expected result set
col1     week_date
4     04/14/2012
6     04/21/2012
*0     04/28/2012*
*0     05/05/2012*
5     05/12/2012
10     05/19/2012
2     05/26/2012Any help would be greatly appreciated.
Thanks,

Hi,
You can use CONNECT BY to gerenate all the dates you need, then outer join your actualdata to that result set, like this:
VARIABLE     start_date     VARCHAR2 (20)
VARIABLE     end_date     VARCHAR2 (20)
EXEC  :start_date := '04/14/2012';
EXEC  :end_date   := '05/26/2012';
WITH     all_dates     AS
     SELECT     TO_DATE (:start_date, 'MM/DD/YYYY')     + (7 * (LEVEL - 1))     AS week_date
     FROM     dual
     CONNECT BY     LEVEL <= 1 + ( ( TO_DATE (:end_date,   'MM/DD/YYYY')
                                 - TO_DATE (:start_date, 'MM/DD/YYYY')
                         / 7
SELECT       COUNT (x.week_date)     AS col1
,       a.week_date
FROM           all_dates  a
LEFT OUTER JOIN  table_x    x  ON  a.week_date = x.week_date
GROUP BY  a.week_date
ORDER BY  a.week_date
I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
Explain, using specific examples, how you get those results from that data.
Always say which version of Oracle you're using.
See the forum FAQ {message:id=9360002}
Edited by: Frank Kulash on May 21, 2012 5:05 PM

Similar Messages

  • Selecting missing date range with previous records value

    Hello,
    SQL> select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE    11.2.0.1.0      Production
    TNS for 32-bit Windows: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    SET DEFINE OFF;
    create table t(NBR_OF_S number, NBR_OF_C number, S_DATE date);
    Insert into  T
       (NBR_OF_S, NBR_OF_C, S_DATE)
    Values
       (34, 40, TO_DATE('05/01/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into  T
       (NBR_OF_S, NBR_OF_C, S_DATE)
    Values
       (27, 29, TO_DATE('03/01/2012 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into  T
       (NBR_OF_S, NBR_OF_C, S_DATE)
    Values
       (21, 23, TO_DATE('12/01/2011 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into  T
       (NBR_OF_S, NBR_OF_C, S_DATE)
    Values
       (19, 20, TO_DATE('10/01/2011 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into  T
       (NBR_OF_S, NBR_OF_C, S_DATE)
    Values
       (18, 19, TO_DATE('09/01/2011 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into  T
       (NBR_OF_S, NBR_OF_C, S_DATE)
    Values
       (17, 17, TO_DATE('08/01/2011 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into  T
       (NBR_OF_S, NBR_OF_C, S_DATE)
    Values
       (16, 16, TO_DATE('06/01/2011 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into  T
       (NBR_OF_S, NBR_OF_C, S_DATE)
    Values
       (9, 9, TO_DATE('12/01/2010 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into  T
       (NBR_OF_S, NBR_OF_C, S_DATE)
    Values
       (5, 5, TO_DATE('11/01/2010 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
    Insert into  T
       (NBR_OF_S, NBR_OF_C, S_DATE)
    Values
       (2, 2, TO_DATE('01/01/2010 00:00:00', 'MM/DD/YYYY HH24:MI:SS'));
    COMMIT;
    SQL> select * from t order by 3 desc;
      NBR_OF_S   NBR_OF_C S_DATE
            34         40 01-MAY-12
            27         29 01-MAR-12
            21         23 01-DEC-11
            19         20 01-OCT-11
            18         19 01-SEP-11
            17         17 01-AUG-11
            16         16 01-JUN-11
             9          9 01-DEC-10
             5          5 01-NOV-10
             2          2 01-JAN-10
    10 rows selected.I want the output like as follows, all those missing date i need to carry on the last one's number
      NBR_OF_S   NBR_OF_C S_DATE
            34         40 01-MAY-12
            27         29 01-APR-12
            27         29 01-MAR-12
            21         23 01-FEB-12
            21         23 01-JAN-12
            21         23 01-DEC-11
            19         20 01-NOV-11
            19         20 01-OCT-11
            18         19 01-SEP-11
            17         17 01-AUG-11
            16         16 01-JUL-11
            16         16 01-JUN-11
             9          9 01-MAY-11
             9          9 01-APR-11
             9          9 01-MAR-11
             9          9 01-FEB-11
             9          9 01-JAN-11
             9          9 01-DEC-10
             5          5 01-NOV-10
             2          2 01-OCT-10
             2          2 01-SEP-10
             2          2 01-AUG-10
             2          2 01-JUL-10
             2          2 01-JUN-10
             2          2 01-MAY-10
             2          2 01-APR-10
             2          2 01-MAR-10
             2          2 01-FEB-10
             2          2 01-JAN-10Any help would be greatly appreciate.
    Note: The date value I have created for this sample is monthly, based on the condition the data value I may need to generate weekly also. That's Monthly or weekly either one
    Thanks,

    And what is AMT? You didn't provide such column in your original post. Anyway, MODEL solution based on original post:
    select  nbr_of_s,
            nbr_of_c,
            s_date
      from  t
      model
        partition by(rowid)
        dimension by(1 d)
        measures(
                 nbr_of_s,
                 nbr_of_c,
                 s_date,
                 months_between(lag(s_date) over(order by s_date desc),s_date) cnt
        rules(
              nbr_of_s[for d from 1 to cnt[1] increment 1] = nbr_of_s[1],
              nbr_of_c[for d from 1 to cnt[1] increment 1] = nbr_of_c[1],
                s_date[for d from 1 to cnt[1] increment 1] = add_months(s_date[1],cv(d) - 1)
      order by s_date desc
      NBR_OF_S   NBR_OF_C S_DATE   
            34         40 01-MAY-12
            27         29 01-APR-12
            27         29 01-MAR-12
            21         23 01-FEB-12
            21         23 01-JAN-12
            21         23 01-DEC-11
            19         20 01-NOV-11
            19         20 01-OCT-11
      NBR_OF_S   NBR_OF_C S_DATE   
            18         19 01-SEP-11
            17         17 01-AUG-11
            16         16 01-JUL-11
            16         16 01-JUN-11
             9          9 01-MAY-11
             9          9 01-APR-11
             9          9 01-MAR-11
             9          9 01-FEB-11
      NBR_OF_S   NBR_OF_C S_DATE   
             9          9 01-JAN-11
             9          9 01-DEC-10
             5          5 01-NOV-10
             2          2 01-OCT-10
             2          2 01-SEP-10
             2          2 01-AUG-10
             2          2 01-JUL-10
             2          2 01-JUN-10
      NBR_OF_S   NBR_OF_C S_DATE   
             2          2 01-MAY-10
             2          2 01-APR-10
             2          2 01-MAR-10
             2          2 01-FEB-10
             2          2 01-JAN-10
    29 rows selected.
    SQL> SY.
    Edited by: Solomon Yakobson on Jun 11, 2012 1:34 PM

  • Format Date Range in Select Statement e.b. 4/10/14 - 4/09/15

    So far thanks for all the help you've provided me on here. I'm a long time Access developer and have just worked with SQL very little throughout the years but now I'm working full-scale in it, so a learning process for me.
    I am familiar with the DateADD function in SQL DATEADD(mm, 1, GETDATE())  AS MyDate. The part that I'm struggling with is that I need to show a date range in a single field. I can not do it by having that function twice because of the character"-",
    which will throw and error. I played around with the "Convert" function some and I am thinking that a combination of the Convert and DateADD functions would be the way to accomplish this but I'm not sure.
    Basically what I need is using today's date as an example, I would need the result to return 04/10/14-04/09/15. Any assistance would be appreciated.

    This is not being used as a back-end to any type of user interface, so doing it on the front-end is not an option. The data is being exported out to text files, so it needs to be exactly as I had in the example as a single field.
    Thanks all for the feedback. Latheesh's post is the closest to what I need, in fact it's exactly what I'm looking for, which is below.
    Select Convert(varchar(20),DATEADD(mm, 1, GETDATE()),10 ) +' ---- '+ Convert(Varchar(20),DATEADD(mm, 12, GETDATE()),10)
    Ok, I got it working. Actually, turns out that it's not much different than Access syntax other than convert is used in place of Format. DateAdd, DateDiff, etc. are all used in Access as well. Thanks for all the help.

  • Date Range Column Selection

    Hi world,
    I've encountered rather weird behavior with Numbers 2.0.3 (iWork '09, update 3 or whatever they've called it). When using the AVERAGEIFS() function, when I select a range of dates to use as a conditional, the range also selects the header cell. All the rest of my ranges (of text and numbers) do not include the header cell. Is this by some kind of design (that I'm not getting) or have I discovered a bug?
    Here is a file that demonstrates this:
    http://files.me.com/link.dupont/6wx2xe.numbers.zip

    Hello
    Most of the time, it's useful to write formulas matching the application's required syntax which is:
    AVERAGEIFS(avg-values, *test-values, condition*, test-values…, condition… )
    In your formula you wrote:
    avg-values: Data::B +is a range (the column A in table Data)+
    I don't know how you may hope to get an average of city names !
    test-values: A2 +is a single cell+
    condition: MONTHNAME(MONTH(Data::A)) +this is not a condition and the fonctions can't apply to a range+
    test-values: B1 +is a cell (must be a range)+
    condition: Data::C +is a range (the column C in table Data but it's not a condition)+
    Here:
    in Data column D the formula is:
    =MONTHNAME(MONTH(A))
    in Table 2 :: B2 the formula is:
    =AVERAGEIFS(Data::C,Data::D,"="&B$1,Data::B,"="&$A)
    Yvan KOENIG (VALLAURIS, France) mardi 6 octobre 2009 09:59:51

  • Setting default date range in selection screen when executing as batch job.

    Hi Guys,
    I have one report to be scheduled as weekly batch job and one of the selection screen field is date range. If i set this report to run today then the date range will be from one week back date(Lower value) to today date(Higher value). When it runs for next week(Already scheduled as weekly batch job) the date range should be like this
    Lower value = today date
    higher value= next week run date.
    How can i achieve this functionality. Is it possible through Dynamic variant concept?. Rest of the selection screen fields have some default values and should not change.
    <REMOVED BY MODERATOR>
    Thanks in advance,
    Vinod.
    Edited by: Alvaro Tejada Galindo on Feb 22, 2008 3:52 PM

    Hi Vinod,
    Would suggest you to this.
    Create two parameters : p_start_date and p_end_date of type sy-datum on your selection screen , instead of a range.
    Now goto create a variant from SE38 for the report.
    While creating the variant, mark the "Selection Variable" checkbox for the two parameters and click on "Selection Variables".
    Select the option "D: Dynamic date calculation" for both the date fields.
    For p_start_date - select the option "Current Date"
    For p_end_date  - select the option "Current date +/- ??? days" and put 7 in the pop up.
    Hence what you have done now is, set up a dynamic variant, where p_start_date will have sy-datum and p_end_date will have sy-datum + 7, everytime the job runs.
    Now, in the program, first step after START-OF-SELECTION code the following:
    RANGES: r_date FOR sy-datum.
    start-of-selection.
    refresh r_date.
    r_date-sign = 'I'. r_date-option = 'BT'.
    r_date-low = p_start_date. r_date-high = p_end_date.
    append r_date.
    Hence this way, you would have built your range and use it as needed.
    Cheers,
    Aditya

  • Single Date Parameter, but using a date range for selection

    Post Author: fireman204
    CA Forum: Formula
    I'm fairly new to Crystal Reports, so be gentle with me.  I have a report that has 4 parameters.  The report asks for data for a specific month, the YTD data to the end of the selected month, and the same data from the previous year.  It seems there should be a way to enter a single parameter (ie., 2007-4-1), and off that date select all the data for the month, the current year to the end of that month, and then the data from the previous year for the same period.  I know this will be a formula field needed to select the data, but not sure how to get there from here.  Any ideas?  Thanks in advance!

    Post Author: SKodidine
    CA Forum: Formula
    It should be possible for you to create just one parameter to have the user input a single date and then create formulae to create the begin and end dates for the month, YTD and PYTD.  You can then use these formulae for record selection criteria.
    For example, if the user inputs a date of 2007-04-01 for the single parameter then create formulae such as:
    beginmonth
    datevar beginmonth;
    beginmonth := date(year({?My Parameter}),month({?My Parameter}),01);
    endmonth
    datevar endmonth;
    endmonth := cdLastDayOfMonth ({?My Parameter});
    To use the cdlastdayofmonth function, In the formula workshop window, click on "Repository Custom Functions" then under CRYSTAL and DATE right click on cdlastdayofmonth and click on ADD TO REPORT.  Once that is done, then create the above "endmonth" formula.  You should see this new function in your formula workshop window in the FUNCTIONS window under CUSTOM FUNCTIONS.
    beginytd
    datevar beginytd := date(year(currentdate),01,01);
    endytd
    datevar endytd;
    endytd := cdLastDayOfMonth ({?My Parameter});
    beginpytd
    datevar beginpytd := date((year(currentdate)-1),01,01);
    endpytd
    evaluateafter({@endytd});
    datevar endytd;
    datevar endpytd;
    endpytd := date(year(endytd)-1,month(endytd),day(endytd));
    In your record selection criteria, you can use the above formulae like this:
    in {@beginmonth} to {@endmonth}
    or
    in {@beginytd} to {@endytd}
    or
    in {@beginpytd} to {@endpytd};
    This is one way of doing it, perhaps others might pitch in with a more efficient way.

  • Date Range on Selection Screen not working

    Hi All,
    I have a selection screen with 3 selection options on there to run a report.
    1) Today
    2) Yesterday
    3) This week
    Now the first two are working fine but number 3 This Week isn't.  Any reason why? This week basically means Monday to Friday of this week. E.g. If I have This week Clicked on Monday it would just show Mondays result, if I run this report on Wednesday with This week clicked it should show Monday, Tuesday & Wednesday.
    Regards
    Adeel
    FORM posting_date .
      CLEAR : rg_finl.
      IF rb_1 = 'X'.
        rg_finl-sign      = 'I'.
        rg_finl-option    = 'EQ'.
        rg_finl-low       = sy-datum.
        APPEND rg_finl.
        CLEAR  rg_finl.
      ELSEIF rb_2 = 'X'.
        rg_finl-sign      = 'I'.
        rg_finl-option    = 'EQ'.
        rg_finl-low       = sy-datum - 1.
        APPEND rg_finl.
        CLEAR  rg_finl.
      ELSEIF rb_3 = 'X'.   
        rg_finl-sign      = 'I'.
        rg_finl-option    = 'BT'.
        rg_finl-low       = sy-datum.
        rg_finl-high      = sy-datum - 7.
        APPEND rg_finl.
        CLEAR  rg_finl.
      ELSEIF rb_4 = 'X'.
        rg_finl[] = s_budat[].
      ENDIF.
    ENDFORM.

    Hello
    You a wrong:
    Instead
    rg_finl-low = sy-datum.
    rg_finl-high = sy-datum - 7.
    you need:
    rg_finl-low = sy-datum - 7.
    rg_finl-high = sy-datum.

  • Error when selecting date range in query designer

    hi all,
    when iam trying to select date range in query designer like 01.04.2009 to 10.04.2009 it has to select only that dates where as it is selecting all the dates in between those like 010.04.2009,01.03.2009,01.02.2009.why this is happening ,iam unable to understand.plzz help me in this issue.
    Vamshi D Krishna

    hi ,
    i have created a variable as you told but no use.still i have to select the dates manuallyone after the other.for more user friendly can i have a calander where i can select date ranges.is it posible to have calander for selecting date ranges instead selecting dates one by one,if posible i request you to give  the detailed steps.plzz guide me in this issue.thanks in advance.
    Vamshi D Krishna

  • Select-options.. Date range..URgent...

    Hi All,
    Can anyone let me know.. how to give last one month date range in select options.
    Regards,
    Parvez.

    Hi,
    In the INITIALIZATION event you can do that.
    v_month = sy-datum+4(2) - 1.
    v_year = sy-datum+0(4).
    concatenate  v_year v_month 01 to v_date1
    concatenate  v_year v_month 31 to v_date2
    Or get the 1st and last dates of the last month and
    s_date-low = date1 (1st date of last month).
    s_date-sign= 'I'
    s_date-high = date2 (last date of last month).
    s_date-option = 'BT'
    append s_date.
    reward if useful
    regards,
    anji

  • How to get top 11 values per date range

    I want to get the top 11 values by date range.
    Sample Data
    CREATE TABLE SAMPLE_DATA
        DOMAIN_NAME VARCHAR2(100),
        QTD         NUMBER,
        LOAD_DATE   DATE
    -- Insert
    BEGIN
      FOR lc IN 1..20
      LOOP
        FOR ld IN 1..30
        LOOP
          INSERT
          INTO SAMPLE_DATA VALUES
              'DM_'
              ||lc,
              round(dbms_random.value(0,1000)),
              SYSDATE-ld
        END LOOP;
      END LOOP;
    COMMIT;
    END;
    SELECT *
    FROM
      (SELECT DOMAIN_NAME,
        QTD,
        LOAD_DATE
      FROM
        (SELECT DOMAIN_NAME,
          QTD,
          LOAD_DATE
        FROM SAMPLE_DATA
        WHERE LOAD_DATE = TRUNC(SYSDATE-3)
        ORDER BY QTD DESC
      WHERE ROWNUM <=10
      UNION ALL
      SELECT 'Others' DOMAIN_NAME,
        SUM(QTD) QTD,
        LOAD_DATE
      FROM
        (SELECT DOMAIN_NAME,
          QTD,
          LOAD_DATE
        FROM
          (SELECT rownum rn,
            DOMAIN_NAME,
            QTD,
            LOAD_DATE
          FROM
            (SELECT DOMAIN_NAME,
              QTD,
              LOAD_DATE
            FROM SAMPLE_DATA
            WHERE LOAD_DATE = TRUNC(SYSDATE-3)
            ORDER BY QTD DESC
        WHERE rn > 10
      GROUP BY LOAD_DATE
    ORDER BY QTD DESC
    -- Result
    DOMAIN_NAME                 QTD                         LOAD_DATE                  
    Others                      2888                        24/03/13                   
    DM_1                        1000                        24/03/13                   
    DM_20                       933                         24/03/13                   
    DM_11                       913                         24/03/13                   
    DM_3                        743                         24/03/13                   
    DM_13                       572                         24/03/13                   
    DM_12                       568                         24/03/13                   
    DM_9                        564                         24/03/13                   
    DM_6                        505                         24/03/13                   
    DM_5                        504                         24/03/13                   
    DM_2                        480                         24/03/13    
    Please, Help me get in one query this result using a range of date.
    e.g
    using LOAD_DATE BETWEEN '24/03/13' AND '25/03/13'
    DOMAIN_NAME                 QTD                         LOAD_DATE                  
    Others                      2888                        24/03/13                   
    DM_1                        1000                        24/03/13                   
    DM_20                       933                         24/03/13                   
    DM_11                       913                         24/03/13                   
    DM_3                        743                         24/03/13                   
    DM_13                       572                         24/03/13                   
    DM_12                       568                         24/03/13                   
    DM_9                        564                         24/03/13                   
    DM_6                        505                         24/03/13                   
    DM_5                        504                         24/03/13                   
    DM_2                        480                         24/03/13                     
    Others                      1948                        25/03/13                   
    DM_1                        807                         25/03/13                   
    DM_8                        764                         25/03/13                   
    DM_7                        761                         25/03/13                   
    DM_11                       656                         25/03/13                   
    DM_18                       611                         25/03/13                   
    DM_17                       523                         25/03/13                   
    DM_14                       467                         25/03/13                   
    DM_19                       447                         25/03/13                   
    DM_15                       437                         25/03/13                   
    DM_6                        380                         25/03/13             Thank you in advance.

    I got the solution. Just sharing.
    I used analytic functions that make my job easy.
    Sample Data
    DOMAIN_NAME                 QTD                         LOAD_DATE                  
    DM_1                        807                         25/03/2013                 
    DM_1                        1000                        24/03/2013                 
    DM_2                        226                         25/03/2013                 
    DM_2                        480                         24/03/2013                 
    DM_3                        244                         25/03/2013                 
    DM_3                        743                         24/03/2013                 
    DM_4                        48                          25/03/2013                 
    DM_4                        413                         24/03/2013                 
    DM_5                        164                         25/03/2013                 
    DM_5                        504                         24/03/2013                 
    DM_6                        380                         25/03/2013                 
    DM_6                        505                         24/03/2013                 
    DM_7                        761                         25/03/2013                 
    DM_7                        212                         24/03/2013                 
    DM_8                        764                         25/03/2013                 
    DM_8                        308                         24/03/2013                 
    DM_9                        354                         25/03/2013                 
    DM_9                        564                         24/03/2013                 
    DM_10                       214                         25/03/2013                 
    DM_10                       367                         24/03/2013                 
    DM_11                       656                         25/03/2013                 
    DM_11                       913                         24/03/2013                 
    DM_12                       37                          25/03/2013                 
    DM_12                       568                         24/03/2013                 
    DM_13                       332                         25/03/2013                 
    DM_13                       572                         24/03/2013                 
    DM_14                       467                         25/03/2013                 
    DM_14                       87                          24/03/2013                 
    DM_15                       437                         25/03/2013                 
    DM_15                       450                         24/03/2013                 
    DM_16                       238                         25/03/2013                 
    DM_16                       299                         24/03/2013                 
    DM_17                       523                         25/03/2013                 
    DM_17                       143                         24/03/2013                 
    DM_18                       611                         25/03/2013                 
    DM_18                       145                         24/03/2013                 
    DM_19                       447                         25/03/2013                 
    DM_19                       464                         24/03/2013                 
    DM_20                       91                          25/03/2013                 
    DM_20                       933                         24/03/2013                  Top 11 QTD of DOMAIN_NAME per Data Range.
    SELECT *
    FROM
      (SELECT DOMAIN_NAME,
        QTD,
        LOAD_DATE
      FROM
        (SELECT LOAD_DATE,
          DOMAIN_NAME ,
          QTD,
          (DENSE_RANK() OVER (PARTITION BY LOAD_DATE ORDER BY QTD DESC )) AS RANK_QTD
        FROM SAMPLE_DATA
        WHERE trunc(load_date) BETWEEN '24/03/2013' AND '25/03/2013'
      WHERE RANK_QTD <= 10
      UNION ALL
      SELECT 'Others',
        SUM(QTD) AS QTD,
        LOAD_DATE
      FROM
        (SELECT LOAD_DATE,
          DOMAIN_NAME ,
          QTD,
          (DENSE_RANK() OVER (PARTITION BY LOAD_DATE ORDER BY QTD DESC )) AS RANK_QTD
        FROM SAMPLE_DATA
        WHERE trunc(load_date) BETWEEN '24/03/2013' AND '25/03/2013'
      WHERE RANK_QTD > 10
      GROUP BY LOAD_DATE
    ORDER BY LOAD_DATE ASC,
      QTD DESC
    DOMAIN_NAME                 QTD                         LOAD_DATE                  
    Others                      2888                        24/03/2013                 
    DM_1                        1000                        24/03/2013                 
    DM_20                       933                         24/03/2013                 
    DM_11                       913                         24/03/2013                 
    DM_3                        743                         24/03/2013                 
    DM_13                       572                         24/03/2013                 
    DM_12                       568                         24/03/2013                 
    DM_9                        564                         24/03/2013                 
    DM_6                        505                         24/03/2013                 
    DM_5                        504                         24/03/2013                 
    DM_2                        480                         24/03/2013                 
    Others                      1948                        25/03/2013                 
    DM_1                        807                         25/03/2013                 
    DM_8                        764                         25/03/2013                 
    DM_7                        761                         25/03/2013                 
    DM_11                       656                         25/03/2013                 
    DM_18                       611                         25/03/2013                 
    DM_17                       523                         25/03/2013                 
    DM_14                       467                         25/03/2013                 
    DM_19                       447                         25/03/2013                 
    DM_15                       437                         25/03/2013                 
    DM_6                        380                         25/03/2013 

  • Stored Procdure date range problem

    Hi All,
    My Vendor created a Stored procedure which asks for a date range when first creating a standard report. Once the date range is entered then I select which data fields I want to display, etc. Once in the report, I can see the parameter fields, but they have a [?] with a weird little yellow icon, and I cannot see the parameter fields in the parameter tab. My users need to be able to change the date range in InfoView, but since there isn't a date range parameter, they cannot, and I also cannot get it to show up in the report in CR 2008. The only time I can get the date range entered is when creating a report, here is the procedure that the vendor gave me:
    XSAC_GET_TEST_COUNT
                          ( P_REPORT_CURSOR  IN OUT XSAC_REPORTS.TEST_COUNT_VIEW_TYPE,
                            P_START_DATE     IN DATE ,
                            P_END_DATE       IN DATE )
    Not sure how to fix this, and neither does the Vendor, although they created it.
    Any help would be much appreciated.
    I have other reports where I have successfully created a date range parameter, and they work fine, this is my first time with a stored procedure. and it asking for a date range when selecting the data source. Not from a date field in the report

    Hi All,
    I found the problem,
    The first Option is: Show on (Viewer) Panel, it was set to Do Not Show . So it was hidden.
    I changed it Editable and it works fine.
    Hopefully this will help someone in the future.

  • Using a sparse lookup with a date range?

    Hey all,
    I have created a table (Benchmark_Lookup) that contains the following columns:
    start_date, end_date, section, benchmark
    I then have numerous logical tables (Eg Business Growth) that will all have a new logical column performing a sparse lookup on the above table to retrieve it's benchmark value.
    In the lookup table, I have multiple rows for the same section with different benchmarks differentiated by the date range that they were in effect.
    I have worked out how to perform this lookup using the following:
    lookup(SPARSE "bla".Benchmark_lookup"."Benchmark" ,0, "bla"."Business_Growth"."section")
    Unfortunately, the above is now bringing back duplicates as it's not working out what date range to select from.
    I have joined the lookup table (using a physical join) to my Time dimension by saying "business_date >= start_date and business_date <= end_Date" but that doesn't seem to work.
    Any ideas?

    Hi there,
    Neither of these examples help that much.
    I understand how the lookup function works but what happens if the lookup table has the following two rows:
    EFFECTIVE_FROM     EFFECTIVE_TO     SECTION     SCORE
    01/Jan/1900                 30/Jun/2013           test              1
    01/Jul/2013                  06/Jun/2079           test              2
    I need to use the following lookup rules:
    Business_Date >= Effective_From
    Business_Date <= Effective_To
    Section = 'Test'
    The lookup should therefore only ever return one row as the date is used to find the appropriate range.

  • MDM ABAP API query to pass the date range

    Hi
    I want to retrieve certain data from MDM repository based on filter criteria by date stamp.
    Not sure how to do it to pass the select option value in the query.
    select-options: s_cdate for sy-datum obligatory .
    DATA  wa_query     TYPE mdm_query.
    DATA: v_search_date1    TYPE MDM_CDT_DATE_TIME.
    data: v_datestamplow1   type string.
    data: v_datestamplow    type TZNTSTMPL.
    concatenate s_cdate-low '000000' into v_datestamplow1
    v_datestamplow  = v_datestamplow1.
    clear wa_query.
        wa_query-parameter_code = 'Changed_On '.             "Field code ( Field name )
        wa_query-operator = 'EQ'.
        wa_query-dimension_type = mdmif_search_dim_field.    "Field search
        wa_query-constraint_type = MDMIF_SEARCH_CONSTR_DATE. "Date  serach
    I am able to get the data when I just pass the low value from selecct option.  But I dont how  to pass the date range.
       v_search_date1-CONTENT = v_datestamplow.
        ET REFERENCE OF v_search_date1 INTO wa_query-value_low.
        APPEND wa_query TO gt_query.
      CALL METHOD cl_api->mo_core_service->query
          EXPORTING
            iv_object_type_code = 'Vendors'
            it_query            = gt_query
          IMPORTING
            et_result_set       = gt_result.
    II could see the below operator types . Although EQ says "Like standard select-options parameter" not sure how to pass the value.
    EQ     Equal to (like standard select-options parameter)
    NE     Not equal to (like standard select-options parameter)
    LT     Less than (like standard select-options parameter)
    LE     Less than or equal to (like standard s-o parameter)
    GT     Greater than (like standard select-options parameter)
    GE     Greater than or equal to (like standard s-o parameter
    SW     Starts with (MDM specific parameter)
    Thanks,
    Krishna.

    Hi,
    To get the date range for select options, pass the low value with 'GE' operator and another query option with 'LE' operator for high value.
    select-options: s_cdate for sy-datum obligatory .
    DATA wa_query TYPE mdm_query.
    DATA: v_search_date1 TYPE MDM_CDT_DATE_TIME.
    data: v_datestamplow1 type string.
    data: v_datestamplow type TZNTSTMPL.
    concatenate s_cdate-low '000000' into v_datestamplow1
    v_datestamplow = v_datestamplow1.
    clear wa_query.
    wa_query-parameter_code = 'Changed_On '. "Field code ( Field name )
    wa_query-operator = 'GE'.
    wa_query-dimension_type = mdmif_search_dim_field. "Field search
    wa_query-constraint_type = MDMIF_SEARCH_CONSTR_DATE. "Date serach
    GET REFERENCE OF v_search_date1 INTO wa_query-value_low.
    APPEND wa_query TO gt_query.
    concatenate s_cdate-high '235959' into v_datestamphigh1
    v_search_date2 = v_datestamphigh1.
    clear wa_query.
    wa_query-parameter_code = 'Changed_On '. "Field code ( Field name )
    wa_query-operator = 'LE'.
    wa_query-dimension_type = mdmif_search_dim_field. "Field search
    wa_query-constraint_type = MDMIF_SEARCH_CONSTR_DATE. "Date serach
    GET REFERENCE OF v_search_date2 INTO wa_query-value_low.
    APPEND wa_query TO gt_query.
    CALL METHOD cl_api->mo_core_service->query
    EXPORTING
    iv_object_type_code = 'Vendors'
    it_query = gt_query
    IMPORTING
    et_result_set = gt_result.
    Thanks.

  • Date range validation

    I have a requirement where i have to check date range in select option and if its more than 45days the I have to give an Informatory message and exit the programme , How can I do that ??
    Urgent Plzz..

    Hi,
      try this code...
    TABLES: zpr_prog_item.
    DATA: cnt TYPE i.
    SELECT-OPTIONS date FOR zpr_prog_item-date_shoot.
    CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES'
      EXPORTING
        i_datum_bis                   = date-high
        i_datum_von                   = date-low
    IMPORTING
       e_tage                        = cnt
    EXCEPTIONS
       DAYS_METHOD_NOT_DEFINED       = 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.
      IF cnt < 45.
        LEAVE TO LIST-PROCESSING.
        WRITE:/ date-low,
              / date-high,
              / cnt.
      ELSE.
        MESSAGE i000(zsam).
        LEAVE SCREEN.
      ENDIF.
    regards,
    Bhuvana.

  • Dynamic date range creation for WebI query

    Hi
    I have a webi query where I need to provide a date range as selection.  But the from date will be based on number of days that user will provide during query execution. For e.g. user will give no of days as 10 so the date range need to be created as  (system date -10) to (system date).
    I am not sure how to provide the option for user to input no of days and then calculate the date range.
    Could you please help me here.
    Regards,
    Amit

    Amit.
    it can be done but by creating multiple objects.
    create Obj1: @prompt("Enter Number Of days",N,Mono,etc..) and capture the number of days in it.
    Create your second object infact a filter object: Obj2: Sysdate
    Third Object(filter) Obj3:  (Sysdate-(@select(class\Obj1)))
    give the between condition in webi using these two objects
    between Obj2 and Obj3

Maybe you are looking for

  • SQL*Loader - Skipping columns in the source file.

    Hi I have a comma delimted source file with 4 columns. I however only want to load columns 2 and 3 into my table using SQL*Loader. This seems like something that should be fairly simple but I can't seem to find any doc or examples of this. Any guidan

  • Are not mutually convertible in a Unicode program

    Hi guys, I'm getting error: "LS_EDIDD-SDATA and LS_STRUCTURE are not mutually convertible in Unicode Program" I have PRKST which is Amount field in LS_STRUCTURE, which causes this problem. But if I change type of PRKST to CHAR15, then it doesn't give

  • Airplay from multiple computers

    My Windows PC is not seeing my airport express.  I have an airport express hooked up to a pair of powered speakers in my den.  My mac in the living room, which is hooked up to my tv and stereo, sees the airport and I'm able to play music in my den ju

  • ISE Auth Policy with Converged Access

    Hi Im setting up a Dot1X authentication using ISE 1.3 and 5760/3850 WLAN controllers. The problem is that im not able to match my authentication policy defined on ISE. It jumps directly to the default policy, im using Called Station id= SSID but it i

  • User Template folder on server

    We have changed in the office from 10.6 -10.8 with Pages 09 to 10.9 and Pages 5.2 With the old pages we had an alias of the server folder containing the templates in the template folder in teh users library. I tried everything I found with google but