How to display week number in a report

Hi,
I need to show the week number in a report and related sales data for that week. For example, starting from 01-JUL-2009 the week1 should show total of sales from 01-JUL-08-JUL.
Help please....
Thanks
A/A

If you are trying to extract the week number of the calender year...you can use..
sql> select to_char(sysdate,'WW') from dual;
TO
05and then group the sales figures by week...
sql> create table t(
  2     target_date date,
  3     sales       number);
Table created.
sql> begin
  2     for i in 1..30 loop
  3        insert into t values (sysdate-i,100*i);
  4     end loop;
  5   commit;
  6  end;
  7  /
PL/SQL procedure successfully completed.
sql> select week, sum(sales) from (
  2     select sales, to_char(target_date,'WW') week from t)
  3   group by week;
WE SUM(SALES)
05       2100
02      16800
01       8800
04       7000
03      11900However, if your week calculation starts with a particular date like a calender year starting with 01-june-2010, then you would need to calculate the (relative) week number using something like...
  1  select target_date,
  2         trunc(((target_date - to_date('01-june-2010','DD-MON-YYYY'))/7)) week_number
  3*   from t
sql> /In the above code, 01-june-2010 is the date from which my calender year starts.
Please note that since this is relative, you might get negative numbers for weeks.

Similar Messages

  • How to display a variable in the report?

    hi all
    i want to use one complex sql statement which will return only one value and i need to display it in report. i'm new to OBIEE. i thought of creating a repository variable to hold that value. but im not sure of how to display the variable in the report.
    Any idea?
    Your help is appreciated

    Hi where do you want to show that value in answers i mean in which part of answers, you want to show that?
    see this
    http://bischool.wordpress.com/2009/05/05/presentation-variable-values-in-report-titles-or-using-presentation-variable-in-dashboard-text-object-and-narrative-view-directly/
    also see this to where and how to use variables in answers
    http://shivabizint.wordpress.com/2008/10/02/oracle-bi-ee-variables-overview/

  • How to display duplicate key in web report?

    Hi Experts,
    Can anybody tell me how to display duplicate key in web report?
    I know in the Bex analyzer, we can allow the duplicate key to be dispalyed via the 'query property' by right click, and in the 'display option' tab, there is an option which named 'forbid duplicate key', if we don't select this option, the duplicate key will be dispalyed in the report result in BEx analyzer.
    But how can I do this in Web report? Thanks in advance.
    Eileen

    Hi,
    <b>I know in the Bex analyzer, we can allow the duplicate key to be dispalyed via the 'query property' by right click, and in the 'display option' tab, there is an option which named 'forbid duplicate key', if we don't select this option, the duplicate key will be dispalyed in the report result in BEx analyzer.</b>
    Do the same and execute report in web.You can able to see the same.
    Cheers
    Karthik

  • How to calculate week number from system date

    Hi experts,
    how to calculate week number from system date  ?
    thanks.
    SK

    hi,
    The above FM can be used for BADI or customer exit, if it is design level then you can use formula as well, under formula date functions you can use DATE_TO_WEEK.
    regards,
    Arvind.

  • How to display serial number in reports

    Hi,
    I want to display serial number (for each row of records retrieved ) in reports.How can I accomplish that?Please help
    Regards,
    Nycy

    Like this:
    SELECT ROWNUM RN,
    COL1,
    COLN
    FROM (SELECT COL1,
    COLN
    FROM TABLE
    ORDER BY ORDERCONDITION
    or
    sometime you sould use logic like this:
    first, you should take a summry column into relevent group.
    then
    goto its property
    then
    goto Function field
    then
    select Count from list
    then
    select the source means you want to count records acoording to which column.
    then
    select from relevent group cource from Reset at
    Now, give this summary column source to the required field then generate the report.
    If you feel better to understand then give comments otherwise mail me at "[email protected]"I will give you the complete procedure with images.
    Edited by: Waqas Attari on Feb 18, 2009 7:13 AM

  • How to assign request number to a report painter

    hi all
    i have to assign a request number to the report that i have created using report painter.
    please let me know how to assign a request number.
    thank you all in advance.

    Hi,
    If you are creating new report once you press Create on SE38, it would give you a screen where you enter the program details..
    After this You  get a Create Object Entry Screen on which you have to deifne Package ... Please don't select package as $TMP as it would not allow you to create request..
    Select relevant package and Press Save..
    It would give you another screen with blank Request Number..
    Please press the Create Button..
    The system will create a request Number and display in the request number..
    Press Save ..
    Hope this helps..

  • Message-Popup: How to display a number (from variable) in hex-format?

    Hello,
    i have a numeric FileGlobal that is display in a MessagePopup-step with str(FileGlobal.param1)
    How can i change this that it display the number as hexvalue.
    For example if Number is a 10, then the MessagePopup should display a 0xA.
    Thanks for help
    Solved!
    Go to Solution.

    HI,
    You should try this expression Str(FileGlobal.param1,"%X",1 ,True)
    Hope this helps
    Rodéric L
    Certified LabVIEW Architect

  • How to get week number from date

    Hi,
       please mention how to get the number of week from a particular date using fn module?

    Hi Debarshi,
                       Use FM <b>DATE_GET_WEEK</b>
    Reward points if helpful.
    Regards,
    Hemant

  • How to get week number and day in my result?

    hi experts, i have given the data is ID and DATE(yyyymmdd),i want to get output like ID,DATE,WEEKNO,YEAR,MONTH,DAY. how to get this output.
    thanks & regards
    vijay

    In a routine transformation you can call function
    DATE_GET_WEEK
    to get the week number from the date.
    To determ the others, use the substring
    YEAR = DATE(4)
    MONTH = DATE+4(2)
    DAY = DATE+6(2)

  • How to display 3 level hierarchy alv report using SALV

    Hi ,
          I need to display a Hierarchy ALV report with 3 level.I thought of trying CL_SALV_HIERSEQ_TABLE but i am able to display only two level report.
          How can i display the 3 - level heirarchy report using SALV. I don't want to use SALV_TREE.
          Regards,
          Aditya Tanguturi.

    Hi Aditya,
    Please check this thread
    Is it possible to display more than 2 levels us... | SCN
    Thanks !
    Amit

  • How to display field information dynamically in reports

    How to display field information, depending on the description in DOMAINS..dynamically in reports...
    give an example.
    Thanks

    Hi
    the text u should take into the internal table for that and
    it should send into the ALV_GRID_DISPLY
    SLIS_FIELDCATALOG_T_ALV-SELECTION_TEXT = " DOMAIN".
    other wise u should set in the write statement
    write : / '     '.

  • How to display special characteds in OBIEE reports?

    How to display special characters/multi lingual characters in OBIEE reports? Could you please let me know were all I need to make the changes in OBI so as to see the similar set of characters that being saved in database.
    Thanks in advance
    Regards,
    Jeetender
    Edited by: user9353498 on Mar 17, 2010 3:55 AM

    Hi,
    I believe it depends on your database type. If your database query supports it, OBIEE should not have any problem.
    I think there are only 2 constraints which might stop OBIEE from displaying special characters.
    1) OBIEE internal javascript which does not allow special characters
    2) Database type which does not allow special characters in query.
    If you can take care of these 2 reasons, then it should be possible.
    However, experts can shed some more light on it.
    -Vinay

  • Help needed- Reg: Display page number in SQL Reports

    Hi,
    I need to display page number in " page no: X of Y " format where X is current page & Y is total number of pages. Now I am able to display only the current page using ' sql.pno '. but not able to display in ' X of Y ' format.
    Any inputs in this regard will be helpful.
    Thanks & Regards,
    Anilkumar.

    Hello Anil,
    If you have the above requirement for Oracle Reports then follow the steps:
    1.In the Paper Layout view or Paper Design view, choose InsertPage Number.
    2. In the Insert Page Number dialog box, choose from the list the location for the page number.
    3.Click the desired page number format: Page Number Only or Page Number and Total Pages.
    Cheers,
    Suresh

  • Displaying serial number in the report output

    Hi everyone
    may i know hw can we display serial number inthe report output.

    hi,
    Assuming that you wanted to print the entries of internal table record by record ... do this way ...
    loop at itab.
    write : sy-tabix.  " Record Position
    endloop.
    Regards,
    Santosh

  • How to display BAR-CODE through ABAP report

    Hi,
    Could you please help me, how to display BAR-CODE through the ABAP report.
    I am writing below code, but BAR-CODE is not displaying on report.
               PRINT-CONTROL FUNCTION 'SBP01'.
                WRITE: 20  BAR_CODE1 NO-GAP.
               PRINT-CONTROL FUNCTION 'SBS01'.
    Regards,
    SSRAJU.

    Hi RAJU,
    you can see this forum link and its sub-links, here it is clear about it.
    Re: Barcode printing on report
    Thanks & Regards,
    Dileep .C

Maybe you are looking for

  • Can't add users' home folders to Windows Libraries - "unindexed network location" error

    I am unable to add our users' home folders to their Windows Libraries on client PCs.  Windows is giving an unindexed network location error. This worked perfectly fine in WHS 2011, but is failing on WSE 2012 R2 Essentials. I've checked the indexing s

  • Problem with ResourceBundle in Jar

    Hi, I've written the following class which works perfectly in my program but not when used in the same code but distributed as a Jar file. In this case, only the default locale is used on a "Messages.getString" call, even if I swith the local to Engl

  • How to validate XML Schema in DOM?

    I've got an XML file and corresponding XSD file. How do I validate this XML file when using DOM parser? Thanks

  • Link between DMS DIR and cFolders

    Hi,      We are creating documents directly in cFolders. After collaboration with users, we are pushing the final document to R/3 DMS. But we need to know, for which cFolder scenario this DMS document has been created. Is there any way we can find ou

  • Lightroom 5 Abo with Photoshop

    HI, I habe installed Lightroom 4 on my Macbook. NOw I woul like to additonally install Lightroom 5 from the Abo with it, but I can´t download it. The mobile version for my Ipad was no problem...