How to create a report (timesheet) with columns as the row values?

Hello

I created a table in APEX 4.2.2.00.11...

CREATE TABLE "TRIAL_3_DETAILS"
  ( "CONSULTANT" VARCHAR2(20),
"CLIENT" VARCHAR2(10),
"PROJECT" VARCHAR2(20),
"BILLABLE" VARCHAR2(10),
"TASK" VARCHAR2(50),
"DATE_" DATE,
"EFFORT" NUMBER
  )
/

 

now, I want to create a report "Time Sheets" where the date values are columns in the weekly timesheet with other columns like customer name, project name, etc...

also, I want the value of the estimated effort to the title of the column date of...

Task

Customer

Project

Bill (Y/N)

< date >

< date >

< date >

< date >

< date >

< date >

< date >

Hours

< Job description >

< empty >

< project >

< empty >

< Estimated effort >

< Estimated effort >

< Job description >

< empty >

< project >

< empty >

< Estimated effort >.

< Estimated effort >

< Job description >

< empty >

< project >

< empty >

< Estimated effort >

< Estimated effort >

< Job description >

< empty >

< project >

< empty >

< Estimated effort >

< Estimated effort >

< Job description >

< empty >

< project >

< empty >

< Estimated effort >

< Estimated effort >

Is it possible to create this type of report?

Syed

MikeKutz wrote:

Use TO_CHAR() to 'calculate' the day of the week.  Then, use this value.

  1. WITH e
  2. (
  3. SELECT consultant, client, project
  4. the task, effort
  5. TO_CHAR(date_,'Day') day_of_week
  6. billable
  7. OF trial_3_details
  8. -WHERE date_ between ____ and ____
  9. )
  10. SELECT *.
  11. E
  12. PIVOT (sum (effort)
  13. FOR that day_of_week IN ('Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday')
  14. )

Note that you actually need to use 'fmDay' as the mask of format of date with this approach. Using of 'Day' will result in all the day_of_week values be padded with blanks to the length of the longest value (Wednesday), then this will be the only match value in the pivot:

SQL> with t as (
  2    select
  3        to_char(trunc(sysdate) + (level - 1), 'Day') d
  4      , round(dbms_random.value(0, 100), 2) z
  5    from
  6        dual
  7          connect by level <= 10)
  8  select
  9      *
10  from
11      t
12  pivot (
13      sum(z)
14      for d in ('Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'));

  'Monday'  'Tuesday' 'Wednesday' 'Thursday'  'Friday' 'Saturday'  'Sunday'
---------- ---------- ----------- ---------- ---------- ---------- ----------
                            83.23

Using "fmDay" avoids filling and the pivot works according to the needs:

SQL> with t as (
  2    select
  3        to_char(trunc(sysdate) + (level - 1), 'fmDay') d
  4      , round(dbms_random.value(0, 100), 2) z
  5    from
  6        dual
  7          connect by level <= 10)
  8  select
  9      *
10  from
11      t
12  pivot (
13      sum(z)
14      for d in ('Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'));

  'Monday'  'Tuesday' 'Wednesday' 'Thursday'  'Friday' 'Saturday'  'Sunday'
---------- ---------- ----------- ---------- ---------- ---------- ----------
    60.16    125.09      44.17      77.5      3.63      82.89      26.22

Tags: Database

Similar Questions

  • How to create a report that will show us the hierarchical structure

    Hi all

    I use studio financial reporting for reports.
    I have a planning application. And I used areas such as the entity Dimension.

    Now, I am creating a report of users to see my hierarchy of dimension entity.
    Something like areas
    East
    West
    North
    South

    I'm able to generate the report, but the hierarchy of areas does not appear...

    Can someone advice if there is an option in the preparation of financial reports to make more visible the hierarchical structure by adding a correct indentation between the parent and child?...

    And Yes, I used a prompt for the entity in the report...

    Thank you

    You could add indentation around the lines of formatting.

    1. Select the line
    2. Select Format
    3. click on the tab of allignment
    4. set a number for the indentation.

    Good luck!

  • I have a column with two values, separated by a space, in each line. How to create 2 new columns with the first value in a column, and the second value in another column?

    I have a column with two values, separated by a space, in each line. How do I create 2 new columns with the first value in one column and the second value in another column?

    Add two new columns after than the original with space separated values column.

    Select cell B1 and type (or copy and paste it here) the formula:

    = IF (Len (a1) > 0, LEFT (A1, FIND ("", A1) −1), ' ')

    shortcut for this is:

    B1 = if (Len (a1) > 0, LEFT (A1, FIND ("", A1) −1), ' ')

    C1 = if (Len (a1) > 0, Member SUBSTITUTE (A1, B1 & "", ""), "")

    or

    the formula of the C1 could also be:

    = IF (Len (a1) > 0, RIGHT (A1, LEN (A1) −FIND ("", A1)), "")

    Select cells B1 and C1, copy

    Select cells B1 at the end of the C column, paste

  • How to create a report based on the item selected from the list of selection?

    Hello

    I created a tables_LOV based on:

    Select table_name table_name user_tab_cols r, d

    where column_name like '% _type % '.

    Then I created a ListOfTables page element, display in a selection list and pointing to tables_LOV.

    I run the page, and I can choose the table I want in the drop-down list.

    How to create a report based on the selected element? (ex: select * from selected_table)

    Thanks in advance

    Salah

    Hi Salah,

    Allright, take a look at this page: http://apex.oracle.com/pls/apex/f?p=vincentdeelen:collection_report

    I think that simulates what you are trying to accomplish. I've implemented the simplest method I could think of.

    The report is based on a collection of apex. If you are not familiar with this, you should study the documentation: APEX_COLLECTION

    To recreate my example, you should:

    (1) create a report (interactive) on your collection

    SELECT *
       FROM APEX_collections
     WHERE collection_name = 'MY_COLLECTION'
    

    (2) create a selection list page_item for the tables that you want to display (in my case, this is called "P38_TABLES")

    (3) create a dynamic action that triggers on the evolution of your selection list page_item. Dynamic action must be a parade of PL/SQL procedure the following code:

    declare
      l_query varchar2(4000);
    begin
      l_query := 'select * from '||:P38_TABLES;
      if apex_collection.collection_exists
            ( p_collection_name => 'MY_COLLECTION' )
      then
        apex_collection.delete_collection
          ( p_collection_name => 'MY_COLLECTION' );
      end if;
    
      apex_collection.create_collection_from_query
        ( p_collection_name => 'MY_COLLECTION'
        , p_query           => l_query
        );
    end;
    

    Make sure that you add your page_item 'Page to send items' section.

    (4) add a real extra action that makes an update of the report area.

    Here are two photos describing the da:

    http://www.vincentdeelen.com/images/OTN/OTN_COLLECTION_REPORT_DA1.PNG

    http://www.vincentdeelen.com/images/OTN/OTN_COLLECTION_REPORT_DA2.PNG

    Good luck and greetings,

    Vincent

    http://vincentdeelen.blogspot.com

  • How to create a photo album with ms office?

    How to create a photo album with ms office? I tried to use picasa, but I don't know how to make an album. I also want to add a text below.

    Click on the Forums link at the top of the page and go on the forums of office to ask. But, if you can not understand Picasa, you'll probably some luck using nothing else. Consider going on the forums of Picasa and get help.

  • How to create a recovery disc with all vista updates?

    original title: how to create a recovery disc with all vista updates without starting from scratch, so I can replace my hard drive?

    My hard drive seems to be dying.  I would replace the drive.  I reloaded vista from scratch with all the updates, but it took forever.  I would like to make a record of recovery with all updates.  IAM on vista Home premium.  32 bit

    If you want a good backup program that backups image, I recommend Acronis True Image 2010:http://www.acronis.com/homecomputing/products/trueimage/.  It offers a free trial, so you can test and if you want it's only about $30 for the original version.  A lot of people I know this program and use it instead of Vista even in versions of Vista that offers imagery as this program does a better job.  Of course you also need a place to put the backup (which will take a lot of space), so also consider.  The best choice would be a USB external hard drive at least as large as the readers you want to back up (not only the data on them, but the entire available disk space, so you miss when you add more information about the disks).

    You cannot use IMGBURN do - it can't do anything like that.  It must be the imagery of backup software.

    I hope this helps.

    Good luck!

    Lorien - MCSA/MCSE/network + / has + - if this post solves your problem, please click the 'Mark as answer' or 'Useful' button at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • How to create a new project with other page with the new version of Muse layouts?

    Hello
    If someone would continue to operate as before with the inadmissible Muse version... is - this posible to have both versions installed? or how to create a new project with other page with the new version of Muse layouts?
    Or how to download third party) 3 different configurations (desktop/tablet/mobile) under the same url with a clean result, like up yet with the Muse does not?

    Thanks for any help,

    Patrick

    Use the new version! What you want to achieve, will work! Go to the 'Page' menu and choose 'Add another Layout' and the missed buttons are in plan view.

  • I need to update the screenshots for a new version of an app existing Itune application to download a new version. Since I did not create the original version, can you guide me how to create a new version with the new version number?

    I need to update the screenshots for a new version of an existing iTunes Connect App asks me to download a new version. Since I did not create the original version, can you guide me how to create a new version with the new version number?

    You must call the assistance of the company and ask them to help you with this. You can find contact information by logging on http://digitalpublishing.acrobat.com/ and looking at the Middle at the bottom of the page.

    Neil

  • How to create a report in excel for a table?

    How to create a report in excel for a table?

    Creating an excel report

    the forage value off markup html on spool on

    coil emp.xls

    Select * from noshow.

    spool off

    moved the markup html off the coast of the coil

  • How to create a menu manual, WITH dropdowns

    How to create a menu manual, WITH dropdowns

    You can use the "Composition" widget with these settings:

    Note: Use triggers to place your text. You can use each box to add all your links on the page in question.

  • How to create a button to download files in the form?

    How to create a button to download files in the form?

    Hello

    Please refer to the link below with a similar discussion.

    Download file button

    Kind regards

    Vivek

  • column of the row

    Database IS 9I

    column to line-> result string

    EX:

    1.

    Select * from a;
    NAME CLASS MY NUM
    SALE 2 10301
    10301 2 SHIP
    SALE 2 10302
    10302 3 SHIP

    -------------------------------------------------------

    2 column in the row

    CLASS NAME 10301 10302-> not fixed
    A      SELL               2                2
    A      SHIP               2                 3

    You can try the below... You can use DBMS_SQL to get it easily... I'm working on which will inform you soon

    FUNCTION to CREATE or REPLACE dyn_row_colum

    RETURN VARCHAR2

    AS

    v_str1 VARCHAR2 (32767).

    v_sqlstr VARCHAR2 (32767): = ' SELECT DBMS_XMLGEN. CONVERT (SUBSTR (XMLAGG (XMLELEMENT (e, val1 |'|)))) '''|| '''|| ' ||'|| '''|| ' ||'|| ''', '''|| ' ||'|| '''|| ' ||'|| '''|| Chr (13) | Chr (10): ' | '''). EXTRACT ('|) '''|| ((((' Text()'| "'| ')), 1), 1) val2

    Of

    (SELECT "|") '||'''''''''|| name||''''''''||''||''||'''''',''''''||''||''||''''''''|| Class';

    v_restr VARCHAR2 (32767).

    BEGIN

    SELECT "' NAME"'. ' ||'|| ''', '''|| ' ||'|| ''' CLASS'''||'||'||''''||','||

    (SELECT DBMS_XMLGEN. CONVERT (SUBSTR (XMLAGG (XMLELEMENT (e, ',' | read).))) Extract ('//Text ()') ORDER BY LUN), 2), 1).

    FROM (SELECT DISTINCT "'|) ' ||'|| '''|| my | " ' ||'|| ' ||'' ' Lun

    A)) | «, » ||'' ' ||'|| Chr (13) | Chr (10): ' val1

    IN v_str1

    DOUBLE;

    FOR j_rec IN (SELECT DISTINCT LUNS FROM one)

    LOOP

    v_sqlstr := v_sqlstr||'||''''''''||''||''||'''''',''''''||''||''||''''''''||'||' MAX (DECODE (Lun,'|)) '''|| j_rec.Mon | " ((' |', num))';

    END LOOP;

    v_sqlstr: = v_sqlstr |' | '''|| (' ' |' val1 to a GROUP BY name, class)';

    EXECUTE IMMEDIATE v_sqlstr INTO v_restr;

    v_restr: = v_str1 | RTrim(v_restr,'||') | « ; » ;

    RETURN v_restr;

    END dyn_row_colum;

    /

    SELECT DYN_ROW_COLUM FROM dual;

    OUTPUT:-

    -------

    "NAME" | «, » ||' CLASS' | «, » ||' 10301' | «, » ||' 10302' | «, » || Chr (13) | Chr (10) | » A'||','||' SHIP '. «, » ||' 2'||','||' 3'||','|| Chr (13) | Chr (10) | » A'||','||' SELL ' | «, » ||' 2'||','||' 2'||','|| Chr (13) | Chr (10);

  • How to create measures of County on columns of flag in FACT with a CONDITON

    I have about 6 flag columns in my table of facts, and I would like to create measures in my report with County as aggregation on these flag columns in a group by on a condition.
    I am able to do this very easily with SQL query but am really stuck with on how to achieve this in OBIEE.


    Each of my measure should be to make a count aggreagation in the column of flag with a condition such as true/false flag.
    For example:
    Measure1 - Select (INV_ID) count of payments_f of the pavilion where 1 = 'TRUE' and Flag2 = 'FALSE' GROUP_BY (COLUMN1)
    Date2 - Select (INV_ID) count of payments_f of the pavilion where 2 = 'TRUE' and Indicateur3 = 'FALSE' GROUP_BY (COLUMN1)
    -----
    -----
    similar conditions for all columns of flag.

    I tried to write the where condition in the tab content of the logical table, but unfortunately it only on the level of the table - which was not very helpful for me

    I'm really grateful if someone can help me on how to do this.

    Thanks in advance

    You must create a new existing logical column in your logical table. Then you must set the physical mapping:
    BOX WHEN FLAG1 = 'TRUE' AND FLAG2 = 'FALSE' THEN ENDS UP 1 0 OTHERWISE.
    Defined sum aggregation rule.

    Kind regards
    Stijn

  • How to create a master/detail with a PK of 4 columns form

    I want to create a report/form (or a master-detail form) based on a table with a primary key of 4 columns. But only up to 2 columns can be présicer at APEX. How can I handle this?

    Sincerely,

    James

    Hi James,

    I think Mike suggests that you create a SQL view on the table and bring together the different values of the primary key in a primary key, unique, unique, nickname. You can always include the individual columns in the SQL, but you can then use this new column as the primary key on a form. However, you also need to create instead of triggers to manage the changes/insertions/deletions that SQL does not update the tables in a view. (See: [http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28370/create_trigger.htm#i2064426] for more details on this Oracle or Re: how to upgrade the table or view for an example within the Apex).

    Ideally, however, you should only really need a column of key - is it necessary for four?

    Andy

  • How to create editable report manually even as a default with on report send the page


    Hello

    Is it possible to create the report updatable manully would even editable report by default.

    I created 4 report can be updated in a single page, but submits the entire page when adding empty lines.

    I need to add additional blank lines using dynamic measurements or any otherwise with the page request.

    Thank you

    RJ

    Thank you Lakshmi,

    His work!

Maybe you are looking for