Can I "count" the number of rows excluding the header and footers

I have some tables that consist of a different number of rows, as the number is part of an equation I need to know the number of rows excluding the header and footers. I have the work around in =ROWS(ColumnG)-3, but is there a tidier way? I want to be able to add footers (or headers) too and not have these counted.
Many thanks
Lee

Hi Lee,
Add a column to your table (for purposes of this discussion, the new column is placed before column C, and becomes the new column C). enter the formula below in all regular cells, but NOT in header or footer cells:
=1
Use the formula below, placed anywhere (except in a regular cell in column C) to get the number of non-header, non-footer cells:
=COUNT($C)
The first formula will automatically be placed in cells added to column C, and the results will change to reflect the added rows.
Regards,
Barry

Similar Messages

  • Can i get a number of rows in the select list??

    Hello~
    I am studying the "oracle call interface". but i don't know much about oci.
    Anyway i want to know that how can i get a number of rows.
    for example, there is a source code of the number of colums in the select list.
    The following is a list of DB(example)
    /*DB table*/
    ID NAME CODE ID
    1 A 1 A
    2 B 2 B
    /*source*/
    err = OCIAttrGet ((dvoid *) stmhp, (ub4)OCI_HTYPE_STMT, (dvoid*)
    &parmcnt, (ub4 *) 0, (ub4)OCI_ATTR_PARAM_COUNT, errhp);
    /*result*/
    The Column is 4. (ID, NAME, CODE, ID)
    So, i think that the row is 3 (ID, 1, 2) in the DB table.
    Simply, Can i get a number of rows in the select list??
    for example,
    err = OCIAttrGet ((dvoid *) stmhp, (ub4)OCI_HTYPE_STMT, (dvoid*)
    &parmcnt, (ub4 *) 0, (ub4)OCI_ATTR_RAW_COUNT, errhp);
    I'm trying to get the number of row count. but i can't find.
    Please, could you let me know that how can i get the number of row count.
    Thank you.

    Thank you for your reply.
    we are tested the source code by reply.
    The following is the test source code.
    /*source code*/
    strcpy (szStatement, "SELECT * from DB_TABLE");
    OCIStmtPrepare(gpOCIReadStmHandle, gpOCIErrHandle, szStatement,
         strlen(szStatement), OCI_NTV_SYNTAX, OCI_DEFAULT);
    OCIStmtExecute(gpOCISvcHandle, gpOCIReadStmHandle, gpOCIErrHandle,
         0, 0, 0, 0, OCI_DEFAULT);
    /* get a number of rows count , Reply : prajithparan*/
    OCIAttrGet((dvoid *)gpOCIReadStmHandle, OCI_HTYPE_STMT, (dvoid *)&nRowCount, NULL, OCI_ATTR_ROW_COUNT, gpOCIErrHandle))
    But There is a problem of the result value.
    The result value is 0. It's mean that the row count is 0. and then we are using the all of fuction is succeed.(return value)
    I don't know what is problem. Please let me know about the problem and solution.
    Thank you.

  • XMLIndex: finding indexed XPaths and the number of rows in the path table

    Hi,
    I am storing non-schema-based binary XMLs in an XMLType column in 11g (11.1.0.6.0) and would like to index the XMLs either partially or fully using XMLIndex. I'm expecting to have a large number (tens of millions) of XML documents and have some concerns about the size of the XMLIndex path table.
    In short, I am worried that the path table might grow unmanageable large. In order to avoid this and to plan for table partitioning, I would like to create a report of all indexed XPaths in an XMLIndex and to find out how many times each path is actualized in the path table. I would do this for a representative XML sample.
    I have been creating XMLIndexes with different exclude/include paths, gathering stats with DBMS_STATS (estimate_percent = 100) and selecting the number of rows in the path table through USER_TABLES.
    If anyone knows a more straightforward way of doing this all advice is very much appreciated.
    Best Regards,
    Rasko Leinonen

    Thanks Marco,
    I managed to get out all indexed paths using the following SQL. It took a while to understand how the join the XDB.X$PT39CW6BJR8W4VVE0G0LLGA0OCR5 and XDB.X$QN39CW6BJR8W4VVE0G0LLGA0OCR5 tables together but got there in the end. This helps to clarify which XPaths are being currently indexed by the XMLIndex.
    begin
    for v_row in (select PATH from XDB.X$PT39CW6BJR8W4VVE0G0LLGA0OCR5)
    loop
    declare
    v_i BINARY_INTEGER := 1;
    v_id raw(8);
    v_len BINARY_INTEGER := 2;
    v_skip BINARY_INTEGER := 1;
    begin
    while v_i < utl_raw.length(v_row.path) and
    v_i + v_len <= utl_raw.length(v_row.path)
    loop
    v_i := v_i + v_skip;
    v_id := utl_raw.substr(v_row.path, v_i, v_len);
    --dbms_output.put_line(v_id);
    for v_row2 in (select LOCALNAME, flags from XDB.X$QN39CW6BJR8W4VVE0G0LLGA0OCR5
    where ID = v_id )
    loop
    if rawtohex(v_row2.flags) = '01'
    then
    dbms_output.put('@');
    end if;
    dbms_output.put(v_row2.localname);
    if v_i + v_len < utl_raw.length(v_row.path)
    then
    dbms_output.put('/');
    end if;
    end loop;
    v_i := v_i + v_len;
    end loop;
    dbms_output.put_line('');
    end;
    end loop;
    end;
    Example output:
    RUN
    RUN/@accession
    RUN/@alias
    RUN/@instrument_model
    RUN/@run_date
    RUN/@run_center
    RUN/@total_data_blocks
    RUN/EXPERIMENT_REF
    RUN/EXPERIMENT_REF/@accession
    RUN/EXPERIMENT_REF/@refname
    RUN/DATA_BLOCK
    RUN/DATA_BLOCK/@name
    RUN/DATA_BLOCK/@total_spots
    RUN/DATA_BLOCK/@total_reads
    RUN/DATA_BLOCK/@number_channels
    RUN/DATA_BLOCK/@format_code
    RUN/DATA_BLOCK/@sector
    RUN/DATA_BLOCK/FILES
    RUN/DATA_BLOCK/FILES/FILE
    RUN/DATA_BLOCK/FILES/FILE/@filename
    RUN/DATA_BLOCK/FILES/FILE/@filetype
    RUN/RUN_ATTRIBUTES
    RUN/RUN_ATTRIBUTES/RUN_ATTRIBUTE
    RUN/RUN_ATTRIBUTES/RUN_ATTRIBUTE/TAG
    RUN/RUN_ATTRIBUTES/RUN_ATTRIBUTE/VALUE

  • How to limit the number of rows in the Custom Control box

    Hi All,
    In my Module pool screen I have a Custom Control box for providing some free text as input. Now, there is no limit in the number of rows allowed for this box.
    But, the requirement is, it should have the maximum number of rows = 99. and each row should have maximum length = 60 characters.
    User should not be allowed to enter more than 60 characters per row and more than 99 rows.
    Could you please let me know how to do this..? Are there any methods available which controls the maximum number of rows and maximum length per row..?
    Please help me in resolving the issue. Thanks in advance.
    Thanks & Regards,
    Paddu.

    By "Custom Control Box", do you mean a Custom Container or a Table Control?
    Anyway, I suggest you to use a table control (not a custom container as your requirement seems to be very precise on that point, maybe ask your client twice to make sure). Look at the examples of table controls in ABAPDOCU transaction.

  • How to increase the number of rows in the array as needed

     hello LV
    I need advice following
    1. To the sine signal of 100 data (100 sampling) to sort 250 rows in the array. It changes the sine signal in the plane that time.
    2. To set up a new row by external trigger signal.
    Thank you

    Hi Nusorn,
    Your question makes little to no sense. Could you explain further, perhaps send some example code of what you have done so far?
    Rgs,
    Lucither
    "Everything should be made as simple as possible but no simpler"

  • How to determine count for the number of rows

    Appreciate if any of you could think of a way of determining the count for the number of rows in the subquery without having to run another query.
    SELECT *FROM
    (SELECT rownum, rn, rlp_id, rlp_notes, cad_pid, status, jurisdiction_id, s.state_abbr, rlp_address, rlp_route_id, rlp_route_section, psma_version FROM ipod.relevant_land_parcels r, state s WHERE s.state_pid = r.state_pid(+) AND rlp_route_id = 'SM1' AND status = 'CURRENT')WHERE rn > 200 AND rn < 216
    And I want to import this into.net and C# environment.

    Something like this,.....????
    SQL> select * from emp;
    EMPNO ENAME      JOB         MGR HIREDATE          SAL      COMM DEPTNO
    7369 SMITH      CLERK      7902 17/12/1980     800,00               20
    7499 ALLEN      SALESMAN   7698 20/02/1981    1600,00    300,00     30
    7521 WARD       SALESMAN   7698 22/02/1981    1250,00    500,00     30
    7566 JONES      MANAGER    7839 02/04/1981    2975,00               20
    7654 MARTIN     SALESMAN   7698 28/09/1981    1250,00   1400,00     30
    7698 BLAKE      MANAGER    7839 01/05/1981    2850,00               30
    7782 CLARK      MANAGER    7839 09/06/1981    2450,00               10
    7788 SCOTT      ANALYST    7566 19/04/1987    3000,00               20
    7839 KING       PRESIDENT       17/11/1981    5000,00               10
    7844 TURNER     SALESMAN   7698 08/09/1981    1500,00      0,00     30
    7876 ADAMS      CLERK      7788 23/05/1987    1100,00               20
    7900 JAMES      CLERK      7698 03/12/1981     950,00               30
    7902 FORD       ANALYST    7566 03/12/1981    3000,00               20
    7934 MILLER     CLERK      7782 23/01/1982    1300,00               10
    14 rows selected
    SQL>
    SQL> select max(rw) from
    2 (
    3 select empno , row_number () over (order by empno) rw from emp
    4 where job='CLERK'
    5 )
    6 /
       MAX(RW)
             4Greetings...
    Sim

  • How to determine the number of rows of data in a datatable?

    I have a datatable that I fill from an SQL query.  I do not know exactly how many rows of data it will return (due to my selection criteria) but will be somewhere between 100 and 300 rows.  I send this data into a report but need to determine the length of the report (panel height data member) programatically based on how much data the query has returned.  So, I need a way to count how many rows are filled in the data table.
    I tried doing a nested "if" statement checking the value of each cell but when I tested the expression at 59 "if" statements (will need 300+) I got a parser error in lookout when I tried to accept the connection.  I also tried a type of loop by assigning cursor.2 either to its own value (circular) or to its own value plus one depending on the value of the cell at cursor.2.  It was close but overshot by one row or more (much more sometimes).
    Any clever ideas?  Perhaps I have just been looking at this problem too long.  Thanks, in advance, for your help.

    Since the datatable gets the data from the SQL query, you can also use the SQL statement to count the number of rows in the query result.  
    For example, in datatable you do "select localtime, trace1 from intdata where xxx". You can get the count by "select count(trace1) from intdata where xxx". Use the same condition in order to get the same number of rows.
    Maybe another SQLExec object is needed to do the count.
    Whenever the datatable executes the SQL, the SQLExec executes and return the count.
    Ryan Shi
    National Instruments

  • How to get the number of rows in a repeating frame ?

    Hi all,
    When I launch a report from forms then sometimes there are data in the report and sometimes there are no data. And the problem is that when there are no data then the frame containing the repeating frame is still displaying and a blank page displays on the report.
    So I want to get the number of rows from the repeating frame so that I can code a format trigger on the frame to display or not the enclosing frame depending on the existence of data from the repeating frame.
    Thank you very much indeed.

    Dear Friend,
    You can achieve this. Define a summary column (say cnt). Select summary type as "COUNT". select any one of columns that are getting displayed in your repeating frame as summary column and provide "reset at" group name (or set this to report if you are defining this field at report level) . This "cnt" variable will contain how many records that will be fetched for your repeating frame (i.e. Group of Repeating frame). You can use this "CNT" variable in your format trigger.
    In this case there is no need to write before report trigger or anything.
    Regards,
    Manish Trivedi

  • How do you return the number of Rows in a ResultSet??

    How do you return the number of Rows in a ResultSet? It's easy enough to do in the SQL query using COUNT(*) but surely JDBC provides a method to return the number of rows.
    The ResultSetMetaData interface provides a method for counting the number of columns but nothing for the rows.
    Thanks

    No good way before JDBC2.0. u can use JDBC2.0 CachedRowSet.size() to retrieve the number of rows got by a ResultSet.

  • Get the number of rows in a cursor?

    Currently I have a pretty simple stored procedure that builds some dynamic SQL then returns those results to some code.
    I would like also to be able to return the number of rows in that cursor back to the Java code, how can I do this? Some sample SQL is shown below:
    l_query := 'Select * from customer';
    OPEN searchResults FOR l_query;
    ???? Select count(*) into totalResults from searchResults; ????
    (^^This last row is the issue)
    I need to return the varaible totalResults as the count
    Thanks heaps!!

    Mark,
    If I understand you correctly, what you desire cannot be done.
    When Oracle opens a cursor, it doesn't know how many rows that cursor will return.
    The only two options is either do a separate query to count the number of rows that the original query will return, or fetch all the rows and see how many you got.
    I recall seeing an example of that in the JDBC sample code on the OTN Web site.
    (But I'm too lazy to look for it for you.)
    Good Luck,
    Avi.

  • How to limit the number of rows in a smart form , sap script.

    Can anyone tell me how to limit the number of rows in the output of a sap script/smart form. I have tried "protect/endprotect" in sap script but have no idea of how to do in smart form. In sap script the only way it has happened is by reducing the size of the main window.

    Hi,
    In Smartform also, why dont you try reducing the size of the window if you want to limit the rows in it. Also if you are printing Line Items in a LOOP, you can write
    LOOP AT T_ITAB FROM 1 TO N in the LOOP Node if you know how many records exactly you want to display in 1 Page processing.
    regards,
    Mahesh

  • Displayin message and fixing the number of rows in a table

    Hi Experts,
    I have a requirement like this
    there is a table, where i need to diplay a message when there are no records and no rows should be visible on that table.
    Also, when the records are populated from the context, i need to fix the number of rows in that table and display the records.
    Please let me know hw this can be achieved.
    Also in the table I have Link to URL, please let me know how to handle this reference, when i set the reference Property, its giving me an error stating that the file doesn't exist when the table gets loaded.
    Thanks in Advance
    Regards,
    Palani

    Hi
    Oh!!  You should to  explain it at first thread itself that you want to display a JPG imange or other WDWebResourceTypetaken form the backend.
    1. So this is not at all a URL
    2. You have to convert binary data to WDWebResource then display it in either Image UI element or other (like PDF , txt etc)
    3
    try
                   //        Read the datasource of the FileUpload
                   IWDResource res = wdContext.currentContextElement().getResource();
                   InputStream in = res.read(false);
                   ByteArrayOutputStream bOut = new ByteArrayOutputStream();
                   int length;
                   byte[] part = new byte[10 * 1024];
                   while ((length = in.read(part)) != -1)
                        bOut.write(part, 0, length);
                   in.close();
                   bOut.close();
                   IPrivateUploadCompView.IImageTableElement ele = wdContext.nodeImageTable().createImageTableElement();
                   ele.setImage(wdContext.currentContextElement().getResource().getUrl(0));
                   ele.setText(res.getResourceName());
                   wdContext.nodeImageTable().addElement(ele);
              catch (Exception e)
                   wdComponentAPI.getMessageManager().reportWarning(e.toString());
    Here I assume that you convert that data to IWDResource type or
    4.
    WDWebResource.getWebResource(wdContext.currentContextElement().getresource(), type);
    // getResource of type binary which u read from BAPI and set it in local context , type is MIMETYPE or hardcode it as "JPG"
    5. Further help
       [Help1|To Displayan Image in Webdynpro Java from Standard Function Module;
    [Help2|http://wiki.sdn.sap.com/wiki/display/KMC/GettinganimagefromKMDocumentstobeusedinWeb+Dynpro]
    [Help3|http://wiki.sdn.sap.com/wiki/display/KMC/GettinganimagefromKMDocumenttobeusedinWeb+DynPro]
    It might code look strange at first , please do some reserch in SDN ,I did my best at this level.
    Best Regards
    Satish Kumar

  • Number of rows in the ALV, Web - dynpro

    Hi all
    I have an ALV in my ABAP web-dynpro. For this alv i would like to set the visible rows at the same number as there are rows in the internal table which is the supplier for the ALV.
    In the TABLE component of the WEBDYNPRO you have a visible property who is controlling this.
    I saw that for the ALV you had the same. Of the class IF_SALV_WD_TABLE_SETTINGS there is a method SET_VISIBLE_ROW_COUNT. So i thought this is the one where i can control it.
    So when the table has 10 rows, 10 rows will be displayedon the screen and when the table has 20 rows, 20 rows will  be displayed on the screen.
    But this is not the case.
    Is there something i forget?
    Kind regards,
    Anton Pierhagen

    METHOD wddoinit .
      DATA: lo_column TYPE REF TO cl_salv_wd_column,
            lo_cmp_usage TYPE REF TO if_wd_component_usage,
            lo_interfacecontroller TYPE REF TO iwci_salv_wd_table,
            lt_functions TYPE salv_wd_t_function_std_ref,
            ls_function TYPE salv_wd_s_function_std_ref,
            lo_function TYPE REF TO cl_salv_wd_function_std,
            lo_data TYPE REF TO if_wd_context_node,
            lo_element TYPE REF TO if_wd_context_element,
            lv_index TYPE i,
            lo_model TYPE REF TO cl_salv_wd_config_table.
    Retrieve ALV object
      lo_cmp_usage = wd_this->wd_cpuse_alv( ).
    Initial? Create new
      IF lo_cmp_usage->has_active_component( ) IS INITIAL.
        lo_cmp_usage->create_component( ).
      ENDIF.
    Interfacecontroller
      lo_interfacecontroller = wd_this->wd_cpifc_alv( ).
      lo_model = lo_interfacecontroller->get_model( ).
    Get main NODE DATA, this is the node which supplies the ALV
      lo_data = wd_context->get_child_node( name = 'DATA' ).
    How many rows has the table?
      lv_index = lo_data->GET_ELEMENT_COUNT( ).
    Not more then 20 rows on the screen
      IF lv_index GT 20.
        lv_index = 20.
      ENDIF.
    Put the number of rows in the screen
      lo_model->if_salv_wd_table_settings~set_visible_row_count( lv_index ).
    should the screen set to freeze?
      lo_model->if_salv_wd_table_settings~set_fixed_table_layout( abap_true ).

  • Classic Report limit the number of rows displayed

    Hi All,
    In my application I have a classic Report which show the data of a simple query. For lay-out reasons I want to limit the number of display to 5 instead of the default 15. I've looked in several forums and they told me that I have to set the number of rows in the report attributes.
    But it did not what I want. I'm Using APEX 4.1.0 on a Oracle 11G database
    My question is: How can I limit the maximum number of rows in a classic SQL Report.

    Hamertje16 wrote:
    In my application I have a classic Report which show the data of a simple query. For lay-out reasons I want to limit the number of display to 5 instead of the default 15. I've looked in several forums and they told me that I have to set the number of rows in the report attributes.And did you do so?
    But it did not what I want. I'm Using APEX 4.1.0 on a Oracle 11G databaseHow did it not do what you want? Displayed an error? Displayed no rows? Displayed 15 rows? Displayed some other number of rows? We can only help if we fully understand the nature of the problem.
    My question is: How can I limit the maximum number of rows in a classic SQL Report.To display 5 rows per page set the report's Number of Rows attribute to *5*.
    However, pagination settings get cached for the duration of the session. For this change to be instantly visible, either log out, restart the brower, and log in again, or manually re-request the page from the browser address bar, adding 'RP' in the ClearCache position in the URL.

  • Trying to find the number of rows in a ResultSet

    I am trying to find the number of rows in a ResultSet, using the following code:
    rs = st.executeQuery(query);
    rs.last(); // to move the cursor to the last row
    System.out.println(rs.getRow());
    However, I am getting this error:
    java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Unsupported method: ResultSet.last
    Whats going wrong??

    praveen_potru wrote:
    You might have not used scrollable result set..
    Try like this:
    stmt = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);rs = stmt.executeQuery(sqlString);
    // Point to the last row in resultset.
    rs.last();
    // Get the row position which is also the number of rows in the ResultSet.
    int rowcount = rs.getRow();
    System.out.println("Total rows for the query: "+rowcount);
    cheersAnd I hope the OP would read it because the thread is a year old.

Maybe you are looking for

  • Office 2004 could not be opend because you do not have sufficient access...

    I just created a second user acount on my imac. I went to go and open microsoft word. On the folder there was a little red circle with a line it it. I clicked on the folder and got this message. The folder "Microsoft Office 2004" could not be opened

  • BALANCE SHEET ADJEST MENT A/C

    HI, IN OBA1 TO THE GL ACCOUNT I HAVE ASSIGNED GAIN A/C AND LOSS A/C WHERE ONE MORE FIELD IS THERE WHICH IS BALANCE SHEET ADJESTMENT ACCOUNT Thanks and Regards   Chiru

  • Training & Event Mng Master data integration

    HI All We have training and event management successfully working, able to run reports to find the attendance list against a course. I would like to know, is there an option to manager to view what and all trainings his subordinates attended from his

  • Applet can not run without JRE

    I have compiled the applet with J2SE 1.4.0. When I tested on the browser IE 5.0 in my computer, it could run because there is JRE included by J2SE 1.4.0 in my computer. When I tested in other computers, it can not run.the display only gray rectangle

  • ORA-01555 in Oracle 9.2.0.5

    we running Baan IV on a Oracle 9.2.0.5 database. Sometimes we got an error in the alert log file like: ORA-01555 caused by SQL statement below (Query Duration=60440 sec, SCN: 0x0001.a452e41c) Now, i want to know which user with which sql-statement (i