How to include row count in report

I have a report which shows list of available classes for students to register. One table called reg (which is not included in the report) keeps student_id and class_id numbers so that we know who signed up for which class.
I'd like to count rows in the reg table and group them by classid and then include results in the report so that we know how many students already signed up for each class. How can I do that?

I assume that you are providing the report with some SQL to pull in the available classes. Why don't you put in a sub select where you are doing a count on the other table?
So for example,
SELECT a.CLASSID, a.CLASSNAME, (SELECT COUNT(*) FROM STUDENTS where CLASSID = a.CLASSID ...Your group by, etc...) as Current FROM CLASSES

Similar Messages

  • 3.0.9.8.5 - Total Row Count in reports

    "Total Row Count" seems to be broken after applying patch 3.0.9.8.5.
    After applying the patch, we viewed an existing report which returned (let's say) 25 rows (and I've got max rows per page set to 5):
    The first page correctly says: "Total Row Count in Report- 25" and "Row(s) 1 - 5 "
    But then clicking the 'next' button, the following page incorrectly says: "Total Row Count in Report- 10" and "Row(s) 6 - 10 "
    So, the total row count is getting screwed up. Clicking "previous" in the example above, the total row count goes down to '5'.
    Another 3.0.9.8.5 patch problem appears to be 5 extra <br>'s within the report customize page top level of buttons and the criteria form. Looks ugly.

    Thanks for the reply.
    Is there nothing I can do to fix this problem before the next 3.0.9 patch comes out? We've have perhaps another few months to go before we make the move to portal release 2.
    This one issue with patch 3.0.9.8.5 is mostly definitely a show-stopper for us...we cannot live with customers seeing errors as basic as "total rows" returned in queries....we will have to roll back to our previous patch level 3.0.9.8.3. By doing this, we will continue to get bad customer feedback because of the awful performance introduced by that patch (Internet Explorer HTTP 1.0 vs 1.1 / keepalives / SSL issue). That's not to mention that we won't see the benefits of the content-area export/import bug fixes in this latest pathset.
    So, if there is ANYTHING we can do to fix this one problem, we (and our customers) would greatly appreciate hearing about it.
    thanks,
    -john

  • How to get row count(*) for each table that matches a pattern

    I have the following query that returns all tables that match a pattern (tablename_ and then 4 digits). I also want to return the row counts for these tables.
    Currently a single column is returned: tablename. I want to add the column RowCount.
    DECLARE @SQLCommand nvarchar(4000)
    DECLARE @TableName varchar(128)
    SET @TableName = 'ods_TTstat_master' --<<<<<< change this to a table name
    SET @SQLCommand = 'SELECT [name] as zhistTables FROM dbo.sysobjects WHERE name like ''%' + @TableName + '%'' and objectproperty(id,N''IsUserTable'')=1 ORDER BY name DESC'
    EXEC sp_executesql @SQLCommand

    The like operator requires a string operand.
    http://msdn.microsoft.com/en-us/library/ms179859.aspx
    Example:
    DECLARE @Like varchar(50) = '%frame%';
    SELECT * FROM Production.Product WHERE Name like @Like;
    -- (79 row(s) affected)
    For variable use, apply dynamic SQL:
    http://www.sqlusa.com/bestpractices/datetimeconversion/
    Rows count all tables:
    http://www.sqlusa.com/bestpractices2005/alltablesrowcount/
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Design & Programming
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • How to include the COUNT Function in business rule

    Hi all,
         I am working in oracle data quality in ODI.
         This is regarding the business rule in Data quality.
         I need to count the number of records when my status_type="A".
         But when i include the COUNT function in business rule.
         I find the following error as "*Unspecified Count Function*".
         Waiting for ur valuable reply.
         Thanks in advance,
         JayaPradha P

    Hi,
    The following is the condition I have to be used
    For eg:*Count records in DIM_SERVICE_ORDER_CODE where service_type = ‘P’*
    But when i use COUNT function.
    Im getting the error as "Unrecognised function count"
    waiting for ur valuable reply
    Thanks in advance,
    JayaPradha p

  • How to use row count as the starting point for a sequence

    I want to create a sequence, which starts with the row count on a table. I used the following, but it's not correct. Please help.
    CREATE SEQUENCE "PARTY_POC_S" MINVALUE 1 MAXVALUE 2000000000 INCREMENT BY 1 START WITH
    (select count(*) from "S_PARTY") CACHE 20 NOORDER NOCYCLE ;

    may be someting like this
    NOT RECOMMENDED
    DECLARE
      stCount               NUMBER;
    BEGIN
      SELECT COUNT (*)
        INTO stcount
        FROM S_PARTY;
      EXECUTE IMMEDIATE    'CREATE SEQUENCE PARTY_POC_S MINVALUE 1 MAXVALUE 2000000000 INCREMENT BY 1 START WITH '
                        || stcount
                        || ' CACHE 20 NOORDER NOCYCLE';
    END;

  • How to include a button in report header like rowspan? &logfile generation?

    I am really new to this form and I have some questions on the APEX HTML DB:
    The project I need to work on is like this: Based on some criteria, I need to do a database lookup. Then in the result, I need to be able to edit the individual record. So far it is no problem. Here comes the part that I am not sure how to handle or if it can be handled.
    1.     We need to have the ability to copy down certain columns value to selected rows. Therefore, a "copy down" button needs to be included right under the column header cell. For example, based on certain criteria, the following product information is returned: product description, serial number, price, category etc. The “COPY DOWN” button needs to be listed right under the “serial number” table header and before the first row of the result, like “rowspan” in html table header. Once you click on “copy down”, the first rows’s serial number will be copied to all selected rows “serial number”. – Can a button be put right under a column header? If so, can I even reference the cell value in javascript?
    2.     Since we are doing the batch update, I need to have the ability to maintain a logfile to include date and time and what information is modified. – Can I generate a logfile from APEX HTML DB?
    I am not sure APEX HTML DB is a good candidate for the above two tasks.
    Your help is greatly appreciated.

    Hi user572980,
    Welcome to APEX... the more you'll do with it, the more you'll like it.
    1) Are you using a Tabbed Form? Or are you in a report? I try to get a better idea what you're trying to do. Did you already have a look at the templates? You can have a template for the report for ex., in that you can adapt like you wish (in your case put a button under the column header).
    You can also reference the cell values, but for that I should know where you're in (form, report). When you click right on the page and have a look at Page Source you see what item (reference) it is.
    2) You can make a logfile yes. Are you using packages to do the batch update? In that you can make some code to store the history. In otherwords, out-of-the-box in APEX I don't think it exists, but with PLSQL you can do it (so also in APEX). For ex. the plsql package stores it in a history table and you built a report on top of that.
    Dimitri

  • How to color row in ALV report?

    hi
    I am creating an ALV report using factory method.
    my report is based on itab which contain 3 coulms, 1 column is ERROR_TYPE . how can i color all the rows which contain E in error_type ???
    thanks
    Ami

    TABLES:LFA1.
    SELECT-OPTIONS:LIFNR FOR LFA1-LIFNR.
    DATA:BEGIN OF ITAB OCCURS 0,
    LIFNR LIKE LFA1-LIFNR,
    NAME1 LIKE LFA1-NAME1,
    LAND1 LIKE LFA1-LAND1,
    ORT01 LIKE LFA1-ORT01,
    REGIO LIKE LFA1-REGIO,
    SORTL LIKE LFA1-SORTL,
    CFIELD(4) TYPE C,
    END OF ITAB.
    data:col(4).
    data:num value '1'.
    SELECT * FROM LFA1 INTO CORRESPONDING FIELDS OF TABLE ITAB WHERE LIFNR
    IN LIFNR.
    LOOP AT ITAB.
    concatenate 'C' num '10' into col .
    ITAB-CFIELD = col.
    num = num + 1.
    if num = '8'.
    num = '1'.
    endif.
    MODIFY ITAB.
    ENDLOOP.
    TYPE-POOLS:SLIS.
    DATA:FCAT TYPE SLIS_T_FIELDCAT_ALV.
    DATA:LAYOUT TYPE SLIS_LAYOUT_ALV.
    DATA:SORT TYPE slis_t_sortinfo_alv WITH HEADER LINE.
    DATA:EVE TYPE SLIS_T_EVENT WITH HEADER LINE.
    LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
    LAYOUT-WINDOW_TITLEBAR = 'VENDORS DETAILS SCREEN'.
    LAYOUT-EDIT = 'X'.
    LAYOUT-info_fieldname = 'CFIELD'.
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
    I_PROGRAM_NAME = SY-REPID
    I_INTERNAL_TABNAME = 'ITAB'
    I_INCLNAME = SY-REPID
    CHANGING
    CT_FIELDCAT = FCAT.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = SY-REPID
    IS_LAYOUT = LAYOUT
    IT_FIELDCAT = FCAT
    TABLES
    T_OUTTAB = ITAB.
    this is for coloring cols
    REPORT ZBHCOLOR_COLS.
    TABLES:LFA1.
    SELECT-OPTIONS:C_LIFNR FOR LFA1-LIFNR. " FOR GRID ONLY
    PARAMETERS:LIST RADIOBUTTON GROUP ALV DEFAULT 'X',
    GRID RADIOBUTTON GROUP ALV.
    DATA:BEGIN OF ITAB OCCURS 0,
    LIFNR LIKE LFA1-LIFNR,
    NAME1 LIKE LFA1-NAME1,
    LAND1 LIKE LFA1-LAND1,
    ORT01 LIKE LFA1-ORT01,
    SORTL LIKE LFA1-SORTL,
    REGIO LIKE LFA1-REGIO,
    COL TYPE LVC_T_SCOL,
    END OF ITAB.
    DATA:COLR TYPE LVC_S_SCOL.
    SELECT * FROM LFA1 INTO CORRESPONDING FIELDS OF TABLE ITAB.
    LOOP AT ITAB.
    IF ITAB-LIFNR IN C_LIFNR.
    COLR-FNAME = 'NAME1'.
    COLR-COLOR-COL = '5'.
    COLR-COLOR-INT = '1'.
    COLR-COLOR-INV = '0'.
    COLR-NOKEYCOL = 'X'.
    APPEND COLR TO ITAB-COL.
    COLR-FNAME = 'LIFNR'.
    APPEND COLR TO ITAB-COL.
    MODIFY ITAB.
    ENDIF.
    ENDLOOP.
    TYPE-POOLS:SLIS.
    DATA:FCAT TYPE SLIS_T_FIELDCAT_ALV.
    DATA:LAYOUT TYPE SLIS_LAYOUT_ALV.
    LAYOUT-ZEBRA = 'X'.
    layout-coltab_fieldname = 'COL'.
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
    I_PROGRAM_NAME = SY-REPID
    I_INTERNAL_TABNAME = 'ITAB'
    I_INCLNAME = SY-REPID
    CHANGING
    CT_FIELDCAT = FCAT.
    IF LIST = 'X'.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = SY-REPID
    IS_LAYOUT = LAYOUT
    IT_FIELDCAT = FCAT
    TABLES
    T_OUTTAB = ITAB.
    ELSEIF GRID = 'X'.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = SY-REPID
    IS_LAYOUT = LAYOUT
    IT_FIELDCAT = FCAT
    TABLES
    T_OUTTAB = ITAB.
    ENDIF.
    Reward points if useful.

  • How to include #/Blank Value in Report

    Hi,
    Our cube is loaded with Flat file,The cude didn't had any master data only transaction data.The records are based on user name in flat file there some records with out user name in flatfile with BLANK which is #
    The data is loading into cube where blank is loaded as balk spack
    but in report i want to restrict the user name to exclude the bank (User Name) Records with out user name...But the # is not appearing in the user name list in Bex to restrict...how can i include the #
    Thanks

    Krishna,
    In the report you want to exclude the data where username is #. Correct? And when you try to do that in the Query Designer, you don't see the # value in the list?
    In the list if you dont see it, simplest way is this... There is a search box at the bottom of that screen. In that type #. Dont hit search. Click on the left arrow which moves the values to the right. Now right click on the value and say "Exclude from Selection".
    Let me know if I understood your question correctly and if you can get it to work.
    Gova

  • How to include preUUTloop results in report?

    In preUUTloop the operator is polled to choose a few parameters (messages with 2-3 buttons to choose from)
    How do I record his choces in the report?
    Desirably, this data should be reported in the very beginning on the report only, not in every UUT loop.
    TS3.5
    Thank you!
    Message Edited by fomine on 08-25-2008 09:13 PM

    Hi,
    Take a look at this example.
    I have attached it to every uut just to demonstrate how it works
    I your case i would also override the ModifyReportHeader Callback and add it Report header
    wich is a little bit of work.
    Greetings
    juergen
    =s=i=g=n=a=t=u=r=e= Click on the Star and see what happens :-) =s=i=g=n=a=t=u=r=e=
    Attachments:
    PreUutToReport_TS35.seq ‏25 KB
    PreUutToReport.seq ‏6 KB

  • How to include  images in BAM reports

    Hi all,
    In Oracle 11g BAM , i can see some already existing Demo reports, i the Active Studio.
    in that demo reports i can see a report called SLA Violation.Here in this SLA Vioaltion report there is Updating Orderded list within the list they are showing some images .
    can some one help me how to add images like that..? or tell me the steps..
    i tried creating the similar updating ordered list in my sample report and gave the image links gived in that demo report
    " _switch({Process Due Soon SLA}) case(true):(<span style='width: 8px'><img src='../Images/TradeSubmitted.png'/></span><span style='padding-left: 4px;vertical-align:top;'>Submitted</span>) default( <span style='width: 8px'><img src='../Images/TradeFine.png'/></span><span style='padding-left: 4px;vertical-align:top;'>Fine</span>")_but in the updated ordering list instead of the image im getting entries like this " ):(<span style='width: 8px'><img src='../Images/TradeSubmitted.png'/></span><span style='padding"
    Any suggestions on this is Really appreciated..
    TIA,
    Karthik
    Edited by: karthik !! on 20 Jun, 2011 7:28 AM

    Hi,
    I have used four different ways to display images in my applications depending on which method is the fastest to refresh.
    1. Under Application Attributes > Edit Standard Attributes > Substitutions enter your substitution string (MY_IMAGE_URL) and substitution value(http://somewhere/img)
    and then in the region or template use the following syntax &MY_IMAGE_URL. in your html tags eg. img src="&MY_IMAGE_URL./banner.png" width="x" height="x">)
    I have found this the best for image refresh speed, especially if the image is already cached.
    2. Load your image up into Apex and don't associate it with any application and use the following tag img src="#WORKSPACE_IMAGES#banner.png" width="x" height="x" alt="">
    Good for development as all images not associated to an application are available.
    3. Load your image up into Apex and associate it with an application and use the following tag img src="#APP_IMAGES#banner.png" width="x" height="x" alt="">
    This can be a pain during development when your application numbers continually change.
    4. Use standard http address <img src="http://somewhere/banner.png" width="x" height="x">
    Ben
    Message was edited by:
    Benton

  • How to include "alias" in custom report

    Is there a method for generating a report in Zen 10.1 that will include the name of the computer assigned in zenworks (Alias)? I have tried all obvious choices such as machine name. Its possible to report on the folder that contains the computer but why not the computer's alias itself?

    ABunker,
    It appears that in the past few days you have not received a response to your
    posting. That concerns us, and has triggered this automated reply.
    Has your problem been resolved? If not, you might try one of the following options:
    - Visit http://support.novell.com and search the knowledgebase and/or check all
    the other self support options and support programs available.
    - You could also try posting your message again. Make sure it is posted in the
    correct newsgroup. (http://forums.novell.com)
    Be sure to read the forum FAQ about what to expect in the way of responses:
    http://forums.novell.com/faq.php
    If this is a reply to a duplicate posting, please ignore and accept our apologies
    and rest assured we will issue a stern reprimand to our posting bot.
    Good luck!
    Your Novell Product Support Forums Team
    http://support.novell.com/forums/

  • How to get row count of a sql query

    After firing a query, how can i get the number of records returned by the query from the database, it should be database indipendent.
    Statement stmt = conn.createStatement();
                      stmt.executeQuery(query);After this I want the number of row i.e. the number of records returned by the database.

    Number of rows in a ResultSet may be obtained with:
    ResultSet rs;
    int numRows=rs.last().getRow();
    I would have said this too, as a matter of fact I mentioned scrollable result sets in my post, but as I said, not all drivers support this, and he said he needed it to be database independent, so this method should not be used.

  • How to Use Row Count Transformation

    Environment: SQL Server 2008 R2
    Purpose: Track number of records, which were loaded into each destination, entity tables or affected by data transaction. Record each table name and the number of records for each  table. 
    Code:
    CREATE TABLE dbo.PkgAudit
    PkgAuditID INT IDENTITY(1, 1),
    PackageName VARCHAR(100),
    LoadTime DATETIME DEFAULT Getdate(),
    Status1 Varchar(50),
    Status2 varchar(20),
    Status3 Varchar(20)
    ETL process: See the following pictures. I have two DFT. Reference to the code in details.
    Click here
    The first one as below
    The second DFT
    Logic: Load the data from the staging table/ If matched with SSN then status is record exists in the pkgAudit table. If not matched, records the number of records and the status is inserted table in the DFT#1 (Step#1)
    In DFT#2, record the name of the tables and number of records for each table
    Expected Results:
    1, Pakage, 20140304 10:24:12:17, 4 loaded, 3 inserted in individual and SSN table, 1  exists in SSN
    Problem: In DFT #1, I placed RowCount Transformation. It generated a couple errors. I also dont know how to concatenate the name of the table and the number of records and the status of the affected table (inserted or exists or loaded).
    I am here to learn as my level of competency is novice. I appreciate the support to ease my learning process. Screen shots is highly appreciated. 
    ~ I tried to load more than picture but the editor allows only 2 pic per post. hope MSDN peeps improve it

    Hi Sandra,
    Thank you for your reply.
    The expression is used for a variable, then the variable can be used in your INSERT statement. According to your screenshot, the PkgAudit table has five columns that you need to insert into. Please refer to the following steps:
    1. Create three Int32 type Package scope variables @TotalCount, @InsertCount, and @MatchCount, and specify their initial value to 4, 3, 1 respectively.
    2. Create three String type variables @NumberofRecords, @Status1, and @Status2. Then, set the ValidateAsExpression property of each variable to True, and set the expression for the three variables as follows:
    NumberofRecords:  (DT_STR,10,1252)@[User::TotalCount] + " loaded"
    Status1:  (DT_STR,10,1252) @[User::InsertCount] + " inserted in individual and SSN table"
    Status2:  (DT_STR,10,1252) @[User::MatchCount] + " in SSN"
    Please refer to the following screenshot:
    3. In the Execute SQL Task, modify your SQLStatement to:
    INSERT INTO dbo.PkgAudit(PackageName
    ,LoadTime
    ,NumberofRecords
    ,Status1
    ,Status2
    ) VALUES(?,?,?,?,?)
    4. Click the Parameter Mapping tab of the Execute SQL Task, and set the parameter mapping as follows (supposing all the columns in the PkgAudit table use varchar data type):
    Regards,
    Mike Yin
    TechNet Community Support

  • How to Include hit counter image in email?

    I want to include an image in my mail. I add that image from insert => HTML with img tag but image is attached. I want the image to be loaded in mail from its source not from the attachment.
    Sencerely.

    Instead of using Insert -> HTML you'd better click on the Image icon in the Compose window. It's the icon on the bar with style (Body Text), Font (Variable Width), on the right side between Paragraph and Smiley icon.
    When you add the image there, you have additional options, e.g. not to attach the image to the message...

  • Maximum Row Count - dynamically change

    Hi,
    How can I change dynamically (eg. from some item) value "Maximum Row Count" in "Report Attributes -> Layout and Pagination"?
    Is this possible?
    best regards,
    Jarek

    Thank you for your answer, but I want to do something else.
    I want to show all rows from my query in report with pagination.
    The number of rows increases.
    According to documentation, field "Number of Rows" sets the number of rows which I can see on one page and field "Maximum Row Count" sets the maximum number of rows which I can see on all pages (number of rows to query).
    I thougth, that when I set (before page is shown) a variable from eg. query "SELECT count(*) FROM table", I will be able to put this variable name in "Maximum Row Count" field, to see all rows from my query. However this field is the numeric field and I can't put any variable name there :(
    The only way to always show all records from my query is to set "Maximum Row Count" field to very high number? Is this natural way in apex? Is this only way?
    best regards,
    Jarek

Maybe you are looking for

  • My iTunes keeps logging me out of the Store as I open and close it.

    Before, whenever I closed iTunes, and opened it the next day, I would still be logged into iTunes. But since I redownloaded iTunes, everytime I open and close iTunes, I have to log in to get Album Art and stuff. It's just a minor hinderance, but it's

  • Ipod says that files are being used by another application...please help!

    My ipod lost all of my music but tells me that there is apparently still the same amount of memory used, i just can't access my music. To fix this, i'm trying to restore my ipod and just resync the music. However, every time i click restore i get the

  • IMac 24" GT130 - Issues with Duke Nukem Forever?

    Hi all, I have a 2009 24" iMac Core 2 Duo, 3.06Ghz Nvidia GT130 512mb & 1GB of ram running 10.6.8. However Duke Nukem Forever does not run well and i was wondering if anyone else has had this gmae running on a similer Mac? What is the issue here, is

  • How to Use the Average, Count, or Sum to Validate a Collection

    hi guys , can any one help me with the following problem . I want to use count function in business rules for the validation of entity objects . I am new to ADF BC . and i am not understanding what are the appropriate accessor and attribute for the v

  • [iPhone] Location-aware web app

    I've been tapped to create a web app formatted for use on an iPhone that will display results depending on the user's current location. Since this is a web app, not an internal one, is there a way I can get a user's location sent to a web app (query