Seeking help w/ summary report: group_by and subqueries

Hi Folks,
I've been asked to produce a report that shows, for each line of business, the number of projects, and number of submitted charters and I am having difficulty getting my head around this.
Here are the tables with pertinent fields:
Table: E_PROGRAM
Fields:
ID (Primary Key)
Program_Number
Cost_Center (Foreign Key to E_COST_CENTER)
Table: E_PROJECT
Fields:
ID (Primary Key)
Program_ID (Foreign Key to E_PROGRAM)
Table: E_PROJECT_MONTHLY
Fields:
ID(Primary Key)
Project_ID (Foreign Key to E_PROJECT)
Charter_Name
Table: E_COST_CENTER
Cost_Center (Numeric Value)
LOB (Varchar2)
Getting the first part went well. I came up with: select cc.lob, count(pj.id) "# Projects"
from e_program p,e_project pj, e_cost_center cc
where p.id = pj.program_id
and p.cost_center = cc.cost_center
group by cc.lob;So to extend it ag get the # of Charters I tried a subquery: select cc.lob, count(pj.id) "# Projects",
(select count(pjm.id)
from e_project_monthly pjm, e_project pj
where pjm.file_id is not null
and pjm.project_id = pj.id) "# Charters"
from e_program p,e_project pj, e_cost_center cc
where p.id = pj.program_id
and p.cost_center = cc.cost_center
group by cc.lob;The result is the LOB, Correct number of Projects for the LOB and the total number of Charters for all LOBs.      # Projects # Charters
LOB1     35     40
ALL      111     40
LOB3     30     40
LOB4     4     40
LOB5     4     40
LOB2     38     40How can I get the subquery tied into to the main query?
Thanks so much for your help and time.
Petie

try this... this would work... i dont know how much data u have in these tables, hence, havent thought much about performance...
select pr.lob, pr.projects '# Projects' ch.charters '# Charters'
from
(select cc.lob lob, count(pj.id) Projects
from e_program p,e_project pj, e_cost_center cc
where p.id = pj.program_id
and p.cost_center = cc.cost_center
group by cc.lob) pr,
(select cc.lob lob, count(pjm.id) charters
from e_project_monthly pjm, e_project pj, e_program p, e_cost_center cc
where pjm.file_id is not null
and pjm.project_id = pj.id
and pj.id = p.id
and p.cost_center = cc.cost_center
group by cc.lob) ch
where pr.lob = ch.lob
Thanks

Similar Messages

  • Help with Oracle Report Builder and SQL Server2000

    Hey guys,
    I just installed it Oracle Developer Suite10g with Report Builder and I am trying to use Report builder and wants to connect with SQL Server 2000. The problem that I am running in to is SQL Server 2000 i have is Window Authentication so Does not required to enter user name and password. So how can i connect my report builder to SQL server or is it possible to connect Report builder to SQL server?
    Also, I want to create small practice version of database in Oracle how do i do it? what i mean by that is I installed trial version or Oracle developer 10g from www.oracle.com and now trying to get some knowledge with oracle. Could any one can give me some direction in this matter please.
    Thank You
    Key

    Have a look at the reports help for the purpose header and trailer sections. Here is an exert:
    "Report sectioning enables you to define multiple layouts in the same report, each with a different target audience, output format, page layout, page size, or orientation. You can define up to three report sections, each with a body area and a margin area: the names of the sections are Header, Main, and Trailer. By default, a report is defined in the Main section. In the other sections, you can define different layouts, rather than creating multiple separate reports. If you wish, you can use the margin and body of the Header and Trailer sections to create a Header and Trailer page for your reports."

  • HELP!!:  Report Width And Size Problem

    Hello everybody
    I'm developing reports for Oracle Applications.
    Question.
    1.Can i develop a 255 column report for oracle applications.
    If yes Then
    2.What would be the report width in inches for a 255 Column Report.
    If inches Given
    3.What style would such a report require in oracle applications while registering reports.
    Regards
    Fahad Hameed

    1.Can i develop a 255 column report for oracle
    applications.Yes.
    If yes Then
    2.What would be the report width in inches for a 255
    Column Report.Check the width/height of the printer page, which your are groing to use for the report. And then specify the same in Report builder.
    If inches Given
    3.What style would such a report require in oracle
    applications while registering reports.
    Orientation: Landscape

  • Seeking help for a  report design

    How to create dynamic footnotes, if it's even possible, with Oracle
    Reports?
    A dynamic footnote would be one that appears on a page only if it is
    used on that page.
    For example:
    Regions: South East West North
    Widget A
    S: $1500.
    E: $100.
    Footnotes:
    S = South
    E = East
    ------------- (page break of group or bottom of page) --------
    Widget B
    S: $1500.
    W: $100.
    Widget C
    S: $1500.
    Widget D
    S: $15002.
    W: $100.
    Footnotes
    S= South
    W = West
    We only want the ones that are used on the page to appear on the footnote
    Any help will be appreciated,
    Thanks.

    Hallo Denis,
    I have a similar problem: Want to display some value from the database in a margin field. I created a user parameter v_Title_Crew and pressetted it in the format trigger of a formula field. Used srw.set_field_char (0, :v_Title_Crew) in the format trigger of the margin field to display the content of the variable. But unfortunately this does not work: It seems to me that the margins are prepared before the query is executed; the variable is not set. Before I simply connected the margin field to the variable in the property palette but this didn't work better. Any idea how to solve this problem?
    Thanks and regards - Ulrich

  • Seeking help to create report

    I'm hoping someone can help me.
    I have a report that keeps track of outages based on application. I now need to break down that report and display the percentage of availability for each application by month. If no outage occured on certain days of the month I would need it to output "0.0".
    Does anyone know how I can create a query or pl/sql block to output all days of the month?

    Hello there,
    So I've been very unsuccessful at creating my report.
    I've attempted to use the queries you provided with no success.
    select * from
    (select trunc(start_date,'MONTH')+rownum-1 as each_day
    from outage_info
    connect by rownum <= to_char(last_day(end_date),'DD')
    where start_date between to_date(01-01-07, 'MM-DD-YY') and to_date(01-03-07, 'MM-DD-YY')
    What I'm attempting to do is generate a similar output to:
    Systems : Monday Tuesday     Wednesday System Total Outage Hours     
    1/1/07     1/2/07     1/3/07
    APP1     0.00     2.50 0.00 2.5%     2.5
    APP2     1.75     0.00 3.25 5%          5.0
    APP3      2.00 0.00 1.00 96.5%     3.75
    Where systems represent my applications and the dates can vary based on user input. So in this case they want to see outages between 1/1/07-1/3/07. I also need to display 0.00 if no outages occured on that date.
    My table structure is as follows:
    ID NUMBER
    SYSTEMS VARCHAR2(1000)
    START_DATE DATE
    END_DATE DATE
    TOTAL_HOURS NUMBER
    Can anyone offer up any helpful solutions?
    Message was edited by:
    user553326

  • How do I reset responses (and summary report data) and use my online form for a new application?

    I created my online form, distributed it and captured the responses - worked well.  Now I want to use the same form and start over (track the responses separately from the first time). How do I reset the results / responses? Thanks for any help you provide. 

    Go to the My Forms tab on the main dashboard (were all of your forms are listed). Select your form and hit the duplicate button. This will make a copy of your form and you have the option to include or not include the responses in the copy.
    Randy

  • Summary Report with 4 Dimensions and 5 Facts

    Hello OBIEE Czars:
    I have a problem.
    I am trying to make a summary report with 4 Dimensions and 5 Facts.
    Out of that only 2 Dimensions are Confirmed.
    Now when I try to bring in all the facts, I get view display error.
    I searched forum for similar issues.
    So I have tried following so far.
    1) Add other dimensions as source and set level to Total for those dims.
    - After doing this, I dont get view display error, but I get blank rows for couple of facts.
    2) I am already aggregating all the measures.
    Please help me out.
    This forum has been very helpful so far.
    Thanks.
    ~Vinay

    Hi
    This method seems fine until you run a request that includes a filter on an unconformed dimension.
    The SQL itself should be quite straightforward (see below) but the BI Server instance does not seem to be joining this data correctly after posting the 2 separate queries to the database.
    SELECT
    x.dim1, x.dim2
    x.fact1_agg_measure
    y.fact2_agg_measure
    FROM
    SELECT
    dim1, dim2
    SUM(fact1.measure) fact1_agg_measure
    FROM
    dim1,
    dim2, --UNCONFORMED+
    fact1
    WHERE
    .... .... join fact1 to dimensions as normal
    AND dim2 = 'BUSINESS_IDENTFIER'
    GROUP BY
    dim1, dim2
    ) x,
    SELECT
    dim1
    SUM(fact2.measure) fact2_agg_measure
    FROM
    dim1,
    fact2
    WHERE
    .... .... join fact2 to dimensions as normal
    GROUP BY
    dim1
    ) y
    WHERE
    x.dim1 = y.dim1
    The result set returned in Answers is firstly a correctly aggregated record plus ALL rows from the second query above ??
    Just wondering if anyone else has come across this issue?
    cheers
    Tony

  • Summary Report with cube and rollup

    hi guys,
    i m working a oracle 9i, i need a summary report after query execution. im using rollup and cube but it is giving me unwanted rows as well. for ex below
    Select
    IRH_REFNO,IRH_TDATE,IRH_BDAMT,IRH_RLOCN, IRH_ILOCN,IRH_EXPECTED_DATE,IRH_ADD_USERID ,
    count(*),
    sum(irh_bdamt)
    from IRH
    where IRH_INTYPE='R'
    and IRH_RLOCN='EDP'
    group by cube(IRH_REFNO,IRH_TDATE,IRH_BDAMT,IRH_RLOCN, IRH_ILOCN,IRH_EXPECTED_DATE,IRH_ADD_USERID )
    Order by IRH_TDATE asc
    i want only two columns to be computed at the end of query. i.e sum of BDAMT and count of rows. i dont want any groupings. any alternate for this.
    thanks n regards
    fkhan

    Please post a create table statement, a few insert statements and the expected output, so we can help you.
    Regards,
    Rob.

  • Please help with creating a summary report from data collected in a fillable PDF form.

    I'm sure this has been asked before so I apologize in advance - I'm new to this forum and I'm not quite sure of which section I should be in. If I may just describe a certain scenario of something I am trying to create - could you please point me in the right direction?
    I'm looking to create a summary report/form to help me better organize my patients after each appointment. So data collected from other fillable forms I've created, will lead to the final page to print that will include selections from fillable text boxes or drop down lists, etc to basically summarize each encounter. It should go something like this:
    FORM 1:
    -pt chart #
    -pg age
    -purpose for visit
    -date of visit
    -diagnosis
    -prognosis
    -etc
    SUMMARY page
    On (-date of visit), patient (-pt chart #) arrived with complaint of (-purpose for visit)....
    The diagnosis was determined to be (-diagnosis), treatment to be performed is suggested to be (-treatment) with a (-prognosis) prognosis. Treatment was (accepted or not) and completed on... etc. etc... you get the idea
    Does anyone know how I can do this?
    Thank you all for your time and advice!

    I have downloaded Castor and got some good tutorials, but.......
    There is a problem, when I try to use the Marshaller to get an XML document the following error is reported:
    java.lang.NoClassDefFoundError: org/apache/xml/serialize/XMLSerializer
    I have scanned the Internet looking for a solution, some recommend including Xecers in the Classpath. I downloaded Xerces 2.7.1 and added it to as instructed but this did not work.
    Hope you can help

  • E-Mail Summary Report and Detailed Report Automatically

    Hi, I have just started a new job (1st IT job since leaving college) and I've been told that our Small Business Server 2011 used to email a Summary Report directly to a specified email address, as well as a weekly Detailed Report to the same email address,
    but that has stopped sending reports now. How do i make sure that the reports are automatically generated and sent out via email to the specified address. Any help would be great.

    Hi,
    Based on your description, I understand that there some issue occurred in Report feature in the SBS 2011.
    On current situation, please refer to following steps and troubleshoot this issue. Then check if can help you.
    1. Login the SBS server. Please open Windows SBS Console and select
    Reports tab. In the Reports panel, select a report (Summary or Detailed), then View report properties. In Report Properties page, please select
    E-Mail Options to check if had added the correct user account or e-mail address. Also please select Schedule tab, and check if had configured correctly.
    2. Then manually click
    Generate report option in Tasks. Please check if successfully generated the report. If not, please refer to following TechNet article and repair Monitoring and Reporting features in the SBS server. Then monitor the result.
    Repair Monitoring and Reporting Features
    in Windows Small Business Server 2011 Standard
    3. If generated the report successfully, please manually click
    Generate report and e-mail report option in Tasks. Then check if run successfully. Or any error message occurred?
    4. If this issue still exists, please refer to following path: C:\Program Files\Windows Small Business Server\Logs\MonitoringServiceLogs and check if there has some log files
    which be related to Report (Summary or Detailed). If has, please check if can find some more clues. Meanwhile, please open Event Viewer and check if find some relevant errors. Those may hope us to go further analyze.
    If any update, please feel free to let me know.
    Hope this helps.
    Best regards,
    Justin Gu

  • Creating detail and summary report tabs

    Hi Everyone,
    I want to create two reports on the same query infact two tabs one showing the summary and the other one showing the details.Suppose I have a column Plant in the summary report tab.I want when I click on a particular plant the detail of that particular plant should appear on the details report tab.Can anyone please explain how to proceed in this.
    Regards,
    Neeraj

    Hi Neeraj,
    what sunil mentioned is for BI 4.0 , if you  are using older versions,
    check below link, from page 20 it will help you to solve the problem.
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f0daee1d-0e38-2d10-0c91-8bb4ab5aa266?QuickLink=index&overridelayout=true
    Steps:
    1> duplicate the query,
    so query1 and query 2 will be available.
    2> In query 2 use Plant as optional prompt and  deselect other options.
    For summary report use the objects which is from query1
    For detail report use the objects which is from query2
    Now in summary report click on plant column Right clik>>> hyperlink>>
    paste the following code by changing server and port name
    and click parse.
    http://servername:8080/OpenDocument/opendoc/openDocument.jsp?sType=wid&iDocID=3333&lsWindow=Same&sReportName=DeatailReport&lsSEnter_Plant=(=[Query 1].[Plant])
    in the above link you also has to mention the sReportName becaous you are linking the same  document  detail report.
    and also Enter_Plant here its prompt descriprtion change according to your requirement.
    to get the idocid right click on the report and click properties.use the number in the link.
    Regards,
    Ranganath

  • Detailed and Summary reports in the same rdf

    Hi,
    I am using reports 9i
    The problem
    I wish to create three reports (one in each section) from the same sql statement
    1) A detailed report
    2) A summary by Country.
    3) A summary by Currency
    The SQL pulls in the data at the detailed level , report (1), no problems here
    The SQL return two attributes Country and Currency which I want to group the totals to make reports (2) and (3). I use repeating frames to handle the different Countries and Currencies.
    Question
    How should I structure the Data Model to easily build the reports above. I have successfully created the Country summary, report (2) by creating a Group which includes summary columns breaking on the Country attribute. All going well so far.
    I attempted to create an additional group with summary columns breaking on currency however, when I ran my report this report was breaking on Country and Currency.
    The data model currently looks like
    Query ---> G_CURRENCY --> G_COUNTRY --> G_DETAIL
    Perhaps the issue is not with the data model, but something I am doing in the in the Paper Layout?
    Any help gratefully appreciated.

    I don't think you can do that with only one SQL in the data model though.
    If I were to do that report, I will have to options .
    OPTION 1
    1.) Create 2 SQL in the data model. One SQL will be for the Detail report and either one of the summary (e.g. Currency and Detail ). The other SQL will be for the remaining summary report ( e.g. Country) .
    Then in your paper layout, you just add 3 different groups/repeating frame - one for each group in the data model. Each frame is independent of each other
    2.) The other option is to use aggregates in your SQL. You may use CUBE which is an extension of the GROUP BY clause. Your SQL would look something like
    SELECT COUNTRY, CURRENCY, SUM (col1), COUNT(col2)
    FROM table1, table2
    WHERE <conditions>
    GROUP BY CUBE (COUNTRY, CURRENCY).
    The records returned by this SQL will include the total for the country and currency, as well as the grand total for all the records. You should try this to see what records it will return or look into the Oracle 9i DataWarehousing guide document for more details.
    In your paper layout, you will again have three groups/repeating frame independent of each other. But you have to control which records are to be printed by checking the values of the group columns.
    I hope this helps.

  • Summary report to show all the software components and version installed

    We are using 64bit Windows 2003 and Hyperion Planning and Essbase in 2 separate servers. I am not sure whether Windows can have a summary report to show all the software components and version installed and show it is 32bit or 64bit version installed?
    Thanks!

    Refer steps here to delete SC file.:
    http://support.apple.com/kb/TS2363
    Then proceed to repair your QuickTime. START / CONTROL PANEL / ADD n REMOVE PROGRAMS / highlight QUICKTIME and click CHANGE then REPAIR.

  • Accounts Payable and PO Accrual Reconciliation Summary Report?

    Dear all,
    We are using R12.1.3 and doing the reconciliation AP Vs PO Accrual. However, I run the report "Accounts Payable and PO Accrual Reconciliation Summary Report" and found that one record is strange, like the PO Accrual balance is something -10,000 and the Account Payable balanced is 0.00.
    What does it mean for my case? Please advice.
    Thanks in advance.

    Dear all,
    I rerun " Accrual Reconciliation Load Run" program with data range. After that I re-run "Accounts Payable and PO Accrual Reconciliation Summary Report" and found that everything is fine now.
    I just wondering am I need to run "Accrual Reconciliation Load Run" every month end closing or just run once for up-grade POs?
    Please advice.
    Thanks.

  • How do I get the Questions to show in the 'View Responses' TAB, and then show up in the Summary Report?

    How do I get the Questions to show in the 'View Responses' TAB, and then show up in the Summary Report?

    There are more than one Applications folders. At the root level of your system is an Applications folder for all users, where most installations go. Every user, including you, also has a separat Applications folder.
    Check all of them.

Maybe you are looking for

  • Cannot use the Tether Feature w/ Nikon D700 in Windows 7 Pro 64?

    Just upgraded Lightroom from 2.7 to 3.0, then to 3.3. Am using a Nikon D700 with Windows 7 Pro 64bit. Windows does see the camera, Lightroom does not see the camera. This same camera and USB cable do work fine on my MacbookPro snow leopard. i have se

  • Adding javascript file

    Hi I am a photographer who shoots virtual tours for a living. My clients are increasingly wanting custom html pages in which the virtual tours are placed. I have little html knowledge so iweb is an excellent choice for me to design these pages. I hav

  • Insert Table is disabled

    Coworkers are using Designer ES 8.2 and they keep on telling me that the Insert Table is disabled.  They have uninstalled and reinstalled.  They tell me it works twice and then it becomes disabled from then on.  Anyone else experience this?

  • How do you Batch change TV Shows/Movies/Music Videos?

    Hi, I have a bunch of short films in my iTunes library that I want to change to TV Shows, the only way i have found that I can do this is going one by one and changing them. My question is whether or not there is a 3rd party applescript of applicatio

  • Message restart

    Hello experts, i am wondering at which point messages are getting reprocessed after encoutering a systemerror. At which point does the message restart? I am having multiple messages on errors which failed due to a mapping issue. I solved this problem