Multiple queries in a single report?

I'm having some issues with the ColdFusion Report Builder...
I have a database table called "Items" that includes fields
for Reviewer and Status. I want to create a report that will list a
reviewer, then express the number of items where the Status is
"open" as a total or record count. I want to do the same for total
items, and then express the number of "open" items as a percentage.
For example:
REVIEWER, OPEN ITEMS, TOTAL ITEMS, PERCENT OPEN
John Doe, 10, 20, 50%
Jane Smith, 15, 60, 25%
...and so on.
So far I've only been able to get my report to display the
recordcount of the entire query. In order troubleshoot the problem
I created a regular cfm page to do the same thing. Here's what I
did:
<cfquery name="getreviewers"
datasource="#APPLICATION.datasource#">
SELECT DISTINCT Reviewer
FROM Items
ORDER BY Reviewer
</cfquery>
<cfoutput query="getreviewers">
<cfquery name="getopenitems"
datasource="#APPLICATION.datasource#">
SELECT Status
FROM Items
WHERE Status='open'
AND Reviewer = '#Reviewer#'
</cfquery>
<cfset open = getopenitems.recordcount>
<cfquery name="getallitems"
datasource="#APPLICATION.datasource#">
SELECT Status
FROM Items
WHERE Reviewer = '#Reviewer#'
</cfquery>
<cfset all = getallitems.recordcount>
<cfset percent = (open / all) * 100>
#getreviewers.DR_Item_Reviewer#, #open#, #all#,
#Round(percent)#%
</cfoutput>
That worked great, but as you can see I had to nest a couple
of queries inside a <cfoutput>. I don't know how to
incorporate this into the report builder, as it seems you can only
specify a single query. Another thing that occurs to me is perhaps
I'm going about this the wrong way. Is there perhaps a function
that will display things the way I want them without fussing with
multiple queries? Any help would be greatly appreciated. Thanks in
advance.

It seems like you are trying to do a subreport. You can nest
reports within the report feature...just check out the subreport
feature under the help section. If that doesn't help let me
know.

Similar Messages

  • Can we combine multiple data sources in single report?

    <span style="font-size: 10pt; font-family: Verdana">Can we combine multiple data sources in single report?</span>

    If you can&#39;t do this at the Metalayer (BVs or Universe) - then subreports and shared variables are the method for CR to use multiple datasources in the same report.

  • Have to refresh multiple queries in a single refresh

    Hi  Gurus,
    Our user want  to refresh multiple queries in a single shot instead of opening multiple times. is there any macros or any other way to acheive that?
    Please help me out in this issue.

    Hi there,
    You can use workbook for that.
    Create a workbook with several queries and in the properties of the workbook, on the tab Variables, choose to display the duplicate variables only once.
    This will display only once the popup pf the variables for all the queries.
    Diogo.

  • Multiples Databases in a single Report

    Hi all experts...
    How I can create a parameter to chosse multiples databases... In a single report!
    regards

    Wagner,
    If you have CR Server installed on your network, you can use the Business View Manager to create a Dynamic Data Connection.
    As soon as you add the Business View to your report as the data source, a choose database parameter will be added to your report automatically.
    Also, if your BIG idea works out, please post it. We all love new ideas. Especially when they work.
    Jason

  • Multiple Queries  in Shared Components Report Queries

    Hey all,
    I am creating a report query which has multiple queries and I am running into to some issues with the builder.
    1.Whenever I try to edit a query it always sends me to the same query. (I can see that it is passing a different ID in the url, but the query never changes)
    - Ex: I create a report query and add two queries, SELECT 1 FROM DUAL and SELECT 2 FROM DUAL. no matter which querry i try to edit it always shows SELECT 1 FROM DUAL.
    2. There is no way to delete individual queries.
    - does anyone know a workaround to delete a query? (rather than just deleeting the entire report query)
    Cheers,
    Tyson Jouglet

    This was a bug that has been fixed in APEX version 3.2.1
    (its always helpful to list the version you are using along with your question)
    If you are using this with a BI publisher report layout, you will also get problems with earlier versions as the rowsets don't always get returned in the correct order.
    See this thread for more details....
    Bi Publisher result set question
    I ended up deleting my whole query and spending a long, careful afternoon adding the 33 queries I had in order one by one having made SURE they were all EXACTLY what I wanted using SQL Developer.
    Gus..
    You can reward this reply by marking it as either Helpful or Correct
    ;-)

  • How to insert multiple queries into a single worksheet of same dataprovider

    Hello friends,
    My question is same as this.I want to know how to create a single worksheet(workbook) embedded with multiple queries of same DATA PROVIDER with different VARIABLES assigned to each query.
    Please,send me the relevant steps.
    Regards,
    Mohan Chand Reddy A

    Hi,
    You need to create one query workbook and rest of the queries you can insert manually from Bex tool -
    insert query.
    You need to insert query by adding one more tab in the workbook.
    Keep in mind only one thing that variable ..if you are going to keep variable it will keep on popping up for user entry in it.
    So try to have common variable in the first query and then those value needs to get fed into other query variable as they are running so without any user entry while execution we can see results in all the queries in the workbook.
    If you want to insert a query into a new workbook:
    Choose the symbol for Open...from the BEx toolbar. This brings you to the screen Open SAP BEx:
    Select Queries from the left column.
    Select a query from all those available. The queries are arranged according to InfoProviders.
    Double-click on the required query or choose OK.
    If you want to insert a query into the active workbook:
    Open a workbook and, from the BEx toolbar, choose Tools ® Insert Query.... The query is then inserted into the current worksheet starting at the active cell.
    If you want to insert a query into a workbook template:
    Create a workbook template.
    Insert the query into the workbook template.
    Thanks and regards
    Kiran

  • Add results of different queries in a single report.

    Hi guys,
      I have one problem, plz help me out. Actually I have 3 queries in a report. The three queries come out with a single values each. The queries are suppose ZBQ1, ZBQ2 and ZBQ3 in a single report in Report designer, its name is suppose ZREP1. I need to calculate the sum of 3 results of the previous queries. and show it in a particular section in the report. Please help me out.
    Thanks,
    Niloy

    HI
    Better to use the workbook. just create the workbook with these three reports and place the three reports at bottom in the excel sheet then you caluclate the formula based on your requirement and place that results in top of the excel(workbook).
    Regards,
    Chandra.

  • XML publisher multiple templates in a single report

    Hello
    We are currently implementing PeopleSoft benefits where the user will have an option to select a benefit template from multiple selections and create a report form based from the combination of template he selected.
    My question would be based from the multiple templates, is it possible if the templates be printed out into just one report using xml publisher?
    thank you!

    Yes. This is possible by using sub templates.
    You can declare sub templates in the beginning and then call the sub template.
    You will need to register the sub templates in "Content Library" (Reporting Tools > XML Publisher> Content Library) to be able to call thses from another template.

  • How to print multiple copies of a single report(label) based on a variable

    I have a crystal report v.9 linked to an excel file with multiple rows of information.  Each row contains the label information and one column has the quanity of each label to print.  What feature in crystal do I use and what is the command I will need?   The information changes on a daily basis so I need a formula. Thanks in advance.
    Kurt

    There have been a few posts that have answered this in the past.  (I know because I answered them! :-> )  You might want to search for them.
    But basically, you want to do something like this in an SQL Command data source (MS SQL):
    declare @loop int;
    set @loop = 1;
      -- copy table structure (or otherwise create a temp table):
    select * into #temp from table where numLabels < 0 and numLabels > 0;
    while @loop < 20 -- or whatever a maximum number might reasonably be
    begin
      insert into #temp select * from table where numLabels >= @loop
      set @loop - @loop + 1
    end
    select * from #temp order by name, address  -- something to keep copies of labels together
    HTH,
    Carl

  • How to accept multiple languages in a single report.

    Hi,
    We have a Web I report built based on universe(Oracle DB- Utf-8 codepage), In Data base tables there is a data with multiple languages. But when I run Web I report it is showing the data which is in english but data other than english is showing inverted "?". Could any one please suggest me how the data to be supported in all languages for the Web I report.
    Thanks,
    Mallareddy D.

    You should be creating a universe using the table with filter utilizing a column which accepts a parameter value of language and shows the data in that specific language. This concept is already used in SAP standard audit universe which accepts language for any query and shows the data in that language.. The logic for the derived column for the table should look something like below Table.LANGUAGE = @Prompt(Select language)

  • Runtime / multiple queries (fast) vs. single or'ed one (sloooow) - why?

    Hi!
    I have a rather huge database (actually, a view..) with ~25 million records (rows).
    A query like...
    select * from mydb where id=123;
    ...is executed in a few 1/100 of a second. But I have a list of ~100 id's to be checked. But when I execute
    select * from mydb where id in (123, 345, 456, ... )
    it takes minutes to complete! Of course if a single test runs in time t, I was expecting that N tests would run in N*t time, so O(N). But this is not true. I also tried to use or'ed test for equality instead of "in (...)". No change. Still slooooow.
    I also created these about 100 separate queries, i.e.
    select * from mydb where id=123;
    select * from mydb where id=345;
    select * from mydb where id=456;
    and again, each single one completed in a few 1/100 of a second. So, this way, I get the results in O(N) time.
    Now I wonder why the execution time differs that much. And how I can avoid the long execution time when using a single query. I know the system will "optimize" my query. So it's hard to predict in what way (order) a query is actually process. But it looks like the optimization process fails in this case. Anything I can do?
    Actually, my original query was more like
    select
    from
    smaller_database s
    left join
    big_database b
    on s.id=b.id
    where
    <some conditions on s>
    i.e. the about 100 IDs to look at come from the smaller database.
    Your hints welcome!
    SELECT * FROM V$VERSION;
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    PL/SQL Release 11.2.0.2.0 - Production
    "CORE     11.2.0.2.0     Production"
    TNS for Solaris: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production

    1007845 wrote:
    I still have no idea why...
    select * from mydb where id=123;
    is executed in a few 1/100 of a second, but
    select * from mydb where id in (123, 456);
    takes about three minutes. I tried the explain feature of SQL developer, but the resulting tree is trivial: Just
    - SELECT STATEMENT
    I
    L REMOTE
    I checked the tuning request link. But it all starts you first need to know why the query is that slow...Your post should cover the following information:
    1. The SQL and a short description of its purpose
    2. The version of your database with 4-digits (e.g. 10.2.0.4)
    3. Optimizer related parameters
    4. The TIMING and AUTOTRACE output
    5. The EXPLAIN PLAN output
    6. The TKPROF output snippet that corresponds to your statement
    7. If you're on 10g or later, the DBMS_XPLAN.DISPLAY_CURSOR output

  • Insert multiple queries using either WORKBOOK, WAD or Report Designer

    Hello Guys
    I have a task where I have to insert multiple queries into one single page/sheet & print it out later. For this I can use any one of the tools available: Workbook, WAD or Report Designer.
    1. Workbook - Here I have read that we can use a call back MACRO and some other features.
    2. WAD - Here I have read that we can use: 1. Multiple data providers (one for each query) & 2. Multiple web analysis items linking to each individual data provider.
    3. Report Designer - Since this is the actual 'formatting' tool provided by SAP, I am assuming that this is the right environment to achieve my task.
    My question: Which one out of the above 3 tools is actually feasible? Can someone explain me in detail about how to go about this task. Any 'How to..' docs from SAP would also be most helpful.
    Regards.

    Hi Kashyap,
    I have done similar requirement in Workbook,it has better features and more user friendly than others......it depends on the individual...but U cna meet your requirement thru Workbooks...
    If the Req are complicated then we go for MAcros ,where in we can satify the critical req,say some sort of Dynamic reqs.
    There are lot of threads on Multiple queries in one Workbook....Just search in SDN and u will get lot of Threads on this topic.
    Come bak if u have any other doubts.
    Rgds
    SVU123

  • How do i access multiple bex queries in one crystal reports??

    Hello Experts,
    I have 10 cubes and 30 bex queries on it and i need to create 3 final crystal reports on these 30 queries.
    I am on BI 4.0 & CR 2011. but my client is not on correct SAP patch ie., he is on 15+ but he must be on 23+ to access multiple bex queries on CR 2011 Database expert. (I am unable to see bex queries in Database expert to link couple of bex queries)
    And my client env doesnt have SAP EP for SAP BW Netweaver Connection to create a connection to access cubes or queries in IDT.
    Do my client env need EP? so that SAP BICS Connection will work in IDT?
    How do i approach to achive this...
    Thank you...

    Hi,
    have you checked the option "allow external access" in your query? SAP Toolbar will find all queries but the database export needs this flag to be set.
    Using multiple queries within one crystal report is using the "multi database join feature" of crystal reports. You can link your queries by key fields and crystal will join them in memory. So when there are many queries or many datarows this can be a huge performance killer.
    Actuallly one of our customers is running a report which has more than 20 BEx queries linked together. It runs just fine.
    Please be sure to set your joins correctly. E.g. crystal will try to make a join on the "key figures" sturcture if you let it create a suggestion or it will try to link on all fields of an infoobject. This will bring MDX errors.
    So you should be setting your joins correctly - the [infoobject]-[20infoobject] fields are fine for that.
    I hope you can use some of my words.
    Regards
    Thorsten

  • Multiple Regions as Single Report...

    Hi all,
    I am looking to incorporate multiple regions as a single report...
    Did a quick search in the forum ....i have seen some discussions on multiple reports in a single region....
    my sample application details are as below....
    http://apex.oracle.com/pls/otn/f?p=4500:1000:410975692726494
    workspace name : bi_development
    username: apexforum
    pwd : apexforum
    application name: multiple region in one report.
    Thanks in advance.

    Yes, you can do it.
    Take a look at http://xlspe.com

  • Multiple Queries in a workbook in 2004s

    Hello folks,
    I am currently working on a report rendering strategy for BI 7.0 2004s installation for our organization. While exploring the various options provided by the system, I notice a whole lot of new look to the Bex Analyzer in 7.0. In the earlier version there used to be options to insert multiple queries in a single workbook, but in the new version , I don't seem to see this as an option. Has this feature been taken out or is there another way that I am missing to do this ?
    Are there any how to's for the new Bex Analyzer ?
    I appreciate your response ...
    Thanks

    Nikki,
         All I did was...
         - Inserted an analysis grid in the design mode at the bottom of the first query.
         - Assigned a new query by creating a new data provider in the grid properties.
         - Once I exited the design mode, the new query got refreshed.
    Try using a different query for the new one and see if you are still getting that critical error.
    Sadly, I am getting the same critical error since this morning when I tried to open the workbooks with multiple queries that I created earlier without any problem. I am investigating in the same direction, keep me posted if you get this solved.

Maybe you are looking for

  • Error 7 while using test report VIs

    I'm trying to figure out how to use the Labview test report VIs and I'm getting error 7 message. Please attached VI and error message. Does any one know this can be fixed? Thanks Attachments: LabviewTestReport.vi ‏21 KB Error 7.png ‏34 KB

  • Cannot switch between WPA2 and WPA Enterprise WiFi locations.

    Hello Everyone, I have two Wifi locations I use, a WPA2 and a WPA Enterprise. When I switch locations from one to the other it looks as if that the Airport express resets but does not let go of the active location. I have to manually turn airport off

  • IPhoto 6 duplicates

    I have recently installed iPhoto 6. It's not really a problem but odd nevertheless – when I select a thumbnail and click on "duplicate" I get an alert box saying "The volume for DCSNXXXX.jpg cannot be found. Insert the disk- etc". Clicking on the OK

  • IDOC with Acknowlegment

    Hi Guys, I was going through IDOC acknowlegments but after reading am into scattered understanding. I understabnd as below 1) IDOC to IDOC --> Acknowlegment happends by default 2) Above happend for only WAS 6.4 and for others seetings has to be done.

  • [SOLVED] /dev/mapper/ dm : UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY

    I'm trying to boot my system from multiple machines using only a USB. I have a PC & MacBook Pro. When I have built & configued my system correctly from my MacBook Pro, I have tried to boot it from PC as well to make sure the boot process has no error