How to get a total record count before grouping?

I need to group a report on a formula that does roughly the following:
[record count] / ( [total record count] / 20 )
What this acheives is to label each record with a number of 1 - 20 which I want to group on. Getting this figure is the easy part, what is not working is the fact that I cannot group from a formula that is calculated after grouping. I overcame a portion of this by using "Whilereadingrecords" (rather than "count", running totals, or while printing records) to acheive a record count.
I can't figure out how to get a total record count done before grouping. Is there a way to do this with "WhileReadingRecords"?? Is this even possible?
Thanks
John

Hi John, 
The order of how Crystal does things dictates the order of which features you can use.  Crystal has a two pass method.  In the first pass it does things like passing the query, grouping, summarizing.  In the second pass it does formulas, formatting, etc. 
Unfortunately Crystal does the Grouping before summarizing so what you want to do can't be done in Crystal.  The best way to get around this to either create a SQL Command or view/stored procedure that will do the summarizing for you.  Then in the report you can use it. 
Hope this helps,
Brian

Similar Messages

  • How to get the total record count for the report

    Hi,
    How can I get count of the total records shown in the report. When we set the report attributes, we have an option "Set Pagination from X to Y of Z"
    Does anyone know how can I get the Z value from APEX variables.
    I know we can use that query and get the count but I just want to know how we can use APEX Variables effectively.
    Thanks in advance.

    You write a loop, something like this:
    Go_block('B1');
    If not form_success then
      Raise Form_Trigger_failure;
    End if;
    First_Record;
    If not form_success then
      Raise Form_Trigger_failure;
    End if;
    Loop
      If :system.record_status in('CHANGED','INSERT') then
        -- modify the record here--
      End if;
      Exit when :System.Last_Record = 'TRUE';
      Next_Record;
    End Loop;
    First_Record;But be very careful-- If your block can fetch a large number of rows, (over 100), this loop can take a long time, and you should not use this method. The loop will continue fetching more rows from the database until all rows satisfying the query are retrieved.

  • How to get the total record count in ODI

    Hi
    I have the interface the are file to DB.
    The format is like this..
    HEADER
    DETAIL
    TRAILER
    Now will write the contains of file to DB,
    But i have to insert the total count ie numberof record written from file to DB in my Trailer record.
    can you tell me how can i get the total count of records in file and write it to trailer?
    Also, I want the interface to rollback the data if something fails will loading the data from file., ie. if there are 100 records in file and 50 got transfer and something fails i want to rollabck the 50 records from DB.???
    Thanks :)

    Hi
    You can design a flow for Full load flow and incremental flow from flat file to Table.
    Create a table at target database like.. (create table with last_execution and palce the V_FULL_LOAD value and LAST_EXECUTION_DT columns in last_execution table)
    Add faltfile as table in model, create a variable as V_FULL_LOAD and make sure that the default values is 01-01-1900
    Create one more variable like V_LAST_EXECUTION_DATE (in this variable write a case statement that if V_FULL_LOAD value is 'Y" then full load should happen and same time you should check that V_FULL_LOAD column is balnk then write insert statment else write update statement to update last_execution_dt column, similar for 'N')
    please provide your *personal mail ID*, i will send a doc file realted to your query.
    we have to tables present in work repository (SNP_STEP and STEP_LOG tables) using tables we can get how many records are inserted/updated and we can find how many records are not transfer and gor error.
    Thanks
    Phani

  • How to determine the cursor record count before the "open cursor"?

    Is it possible to determine the record count of an explicit cursor without running a count()? Say, my cursor definition is something like this,
    CURSOR cur_vehicle
    IS
    SELECT os.order_id, os.order_item, vs.part_id
    vs.part_num,
    vs.iso_num,
    vs.model_yr
    vs.dealer_cde,
    vs.cust_cde,
    px.plant_cd
    FROM parts_source vs,
    orders_source os,
    plant_tbl_crossref px
    wHERE os.order_id = vs.order_id
    AND vs.part_id = os.part_id
    AND vs.plant_cde = px.plant_cde
    ORDER BY os.order_id;
    I want to log the count of records returned by the above cursor prior to the first fetch, without running a count(1) for the query in cursor select.
    I know adding " Count(1) over(order by null) " in the cursor SELECT will bring it. But that does not help me log the record count to some log file or table before opening the cursor for processing.
    To conclude, my objective is to update the record count of cursor in some table before processing

    sarvan wrote:
    Is it possible to determine the record count of an explicit cursor without running a count()?
    ..snipped..No. The only way to do it correctly is inside that select.
    Each select is a consistent read. Which means that if this is done as 2 select statements, the 1st select can see a different version of the data than the 2nd select statement. does. So if you want a count and that to be consistent and on the same version of the data than the select, it has to be done as part of the select.
    Also consider what a cursor is. It is not a result set of sorts that is created in memory upfront - with a convenient interface that tells you the size/number of rows of that result set.
    A cursor is basically a program that reads database data as input and produce output. A fetch from a cursor is an instruction for this program to execute and output data.
    There's no data set that is created by the cursor from which the count can be determined. The cursor program does have state variables - like +%RowCount+ that specifies how many rows the cursor has thus far output. And you need to run that cursor to the end (no more output) in order to determine the total number of rows output by the cursor.

  • How to get th displaye record count through SQL*Plus without result

    set lines 155
    set pages 100
    set autoprint on
    variable cv refcursor
    set serveroutput on size 1000000
    set timing on
    set feedback on
    set echo on
    exec proc_name (input1, input2, :cv);how to get the record count without resultset display in the sql*plus promt ...?
    plz help me....

    This is my earilier code
    set lines 155
    set pages 100
    set autoprint on
    variable cv refcursor
    set serveroutput on size 1000000
    set timing on
    set feedback on
    set echo on
    exec proc_name (input1, input2, :cv);
    Then i have tried to execute like this
    declare
    disp SYS_REFCURSOR;
    cv SYS_REFCURSOR;
    cnt number :=0;
    begin
    proc_name (input1, input2, :cv);
    FOR disp in cv --here cv is the set of record set
    LOOP
    --FETCH cv INTO disp;
    EXIT WHEN cv%NOTFOUND;
    cnt := cnt + 1;
    END LOOP;
    dbms_output.put_line(cnt);
    dbms_output.put_line(cv%rowcount);
    CLOSE cv;
    end;
    getting error...
    LOOP
    ERROR at line 8:
    ORA-06550: line 8, column 2:
    PLS-00103: Encountered the symbol "LOOP" when expecting one of the following:
    . ( % ; for
    The symbol "; was inserted before "LOOP" to continue.
    ORA-06550: line 13, column 2:
    PLS-00103: Encountered the symbol "DBMS_OUTPUT"
    ORA-06550: line 13, column 27:
    PLS-00103: Encountered the symbol ";" when expecting one of the following:
    . ( , * % & - + / at mod rem <an identifier>
    <a double-quoted delimited-identifier> <an exponent (**)> as
    from into || bulk
    I have set of executable procedure script for exec procedure1(input1, input2 :cv); , exec procedure1(input1, input2 :cv);,.... like that. But i want only the record count, while we execute all these scripts in the sql promt...How to do that one.. ?

  • How to Get the Total Page Count in XML Reports?

    Hi All,
    we have a requirement where we have to print Page X of Y(Total Page Count of the document).
    But whenever my header group resets the total count is also reseting.
    for e.g.
    I m getting the page 1 of 4, page 2 of 4, page 3 of 4, page 4 of 4 for my first record.
    same way i am getting page 1 of 3 ,page 2 of 3, page 3 of 3 for my second record.
    But the requirement is to display page 1 of 7, page 2 of 7, page 3 of 7, page 4 of 7 for the first header record.
    And page 5 of 7, page 6 of 7 and page 7of 7 for the second record.
    Is there any way to achieve this?
    Thanks,
    Sachin

    You might have better luck getting an answer here:
    BI Publisher

  • How to get the total record in the block before save them

    Hello,
    I need to recalculate the amout for all records in one block before saving them.
    How can I get it?
    Thanks for your helping

    You write a loop, something like this:
    Go_block('B1');
    If not form_success then
      Raise Form_Trigger_failure;
    End if;
    First_Record;
    If not form_success then
      Raise Form_Trigger_failure;
    End if;
    Loop
      If :system.record_status in('CHANGED','INSERT') then
        -- modify the record here--
      End if;
      Exit when :System.Last_Record = 'TRUE';
      Next_Record;
    End Loop;
    First_Record;But be very careful-- If your block can fetch a large number of rows, (over 100), this loop can take a long time, and you should not use this method. The loop will continue fetching more rows from the database until all rows satisfying the query are retrieved.

  • Record count per page , total record count per report in BI Publisher

    hi,
    In Oracle BI Publisher tool , can you please tell me how to display total record count of a report ? as well as how to display record count per page ?
    Thanks for your help
    Regards
    Gayathri

    check inbox. forwarded the updated template

  • Viewer TOTAL record count display CRViewer9

    Post Author: niblick
    CA Forum: General
    A application written in a previous version of Crystal Reports (7 or 8 ?) displays the TOTAL record count in the viewer (not in the report).  I had to upgrade the reports to version 9 (RDC - CRViewer9) and when I preview the report there is no TOTAL record count in the viewer.  How do I enable this in Crystal Reports 9?
    Thanks

    check inbox. forwarded the updated template

  • How i get number of record in repet frame?

    Hi,
    How i get number of record in repet frame?
    Regards
    Jomar

    Jomar,
    you can use Summary Columns in the Data Modell. Create them on group higher that your wished group (so on the pane for an first group of a query), use as Source the primary column and as reset at the group, where the summary column is located.
    If you hide some instances via format triggers, that you could use a counter inside the format triggers to count the rows.
    Regards
    Rainer

  • How To Get The Total Delivered Quantity of a Sales Order

    Hello All,
    I have a requirement of getting the total delivery quantity of the sales order .I have checked it in LIps table but I am getting partially delivered quantity for a schedule line item.Can any one tell me how to get the total delivered quantity.
    Regards,
    Pavani.

    Hi
    Check the Table:
    VBEP  - Sales Document: Schedule Line Data.
    Inside the table check the Quantity Fields.
    Regards,
    Sreeram

  • How to get Grand Total Text in ALV GRID

    Hi Folks,
    I am able to get the SUBTOTAL TEXT .....But i need...
    How to get Grand Total Text in ALV GRID Display...
    Can any one give a Solution for this...

    Hi Surendar,
    Check out this code.. this is showing Total Text in Toal line in the very first column.
    REPORT  zsales_ord_det_1                        .
    TABLES: ztable_10.
    TYPE-POOLS: slis.
    DATA: BEGIN OF it OCCURS 0,
    srno(6) type c,
    name LIKE ztable_10-name,
    age LIKE ztable_10-age,
    END OF it.
    DATA : BEGIN OF it_temp OCCURS 0,
    name LIKE ztable_10-name,
    age LIKE ztable_10-age,
    END OF it_temp.
    DATA: i_fieldcat  TYPE slis_t_fieldcat_alv,
          wa_fieldcat TYPE  slis_fieldcat_alv.
    DATA: v_repid LIKE sy-repid,
           i_index TYPE STANDARD TABLE OF i WITH HEADER LINE,
           gs_layout TYPE slis_layout_alv,
           gd_layout TYPE slis_layout_alv,
           i_sort TYPE STANDARD TABLE OF slis_sortinfo_alv,
           wa_sort TYPE slis_sortinfo_alv.
    START-OF-SELECTION.
      v_repid = sy-repid.
      SELECT * FROM ztable_10 INTO TABLE it_temp.
      LOOP AT it_temp .
        it-srno = 'Total'.
        it-name = it_temp-name.
        it-age = it_temp-age.
        APPEND  it.
      ENDLOOP.
    END-OF-SELECTION.
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
       EXPORTING
         i_program_name               = v_repid
         i_internal_tabname           = 'IT'
      I_STRUCTURE_NAME             =
      I_CLIENT_NEVER_DISPLAY       = 'X'
         i_inclname                   = v_repid
      I_BYPASSING_BUFFER           =
      I_BUFFER_ACTIVE              =
        CHANGING
          ct_fieldcat                  = i_fieldcat[]
       EXCEPTIONS
         inconsistent_interface       = 1
         program_error                = 2
         OTHERS                       = 3
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    wa_fieldcat-row_pos = 1.
    wa_fieldcat-col_pos = 1.
    wa_fieldcat-fieldname = 'SRNO'.
    wa_fieldcat-tabname = it.
    append wa_fieldcat to i_fieldcat.
      LOOP AT i_fieldcat INTO wa_fieldcat.
        IF wa_fieldcat-fieldname = 'AGE'.
          wa_fieldcat-do_sum = 'X'.
          MODIFY i_fieldcat FROM wa_fieldcat.
        ENDIF.
       IF wa_fieldcat-fieldname = 'SRNO'.
         Hide this field so that it can display it's content i.e.
            Total text in Subtotal level
        wa_fieldcat-tech = 'X'.
          wa_fieldcat-no_out = 'X'.
          MODIFY i_fieldcat FROM wa_fieldcat TRANSPORTING tech no_out.
       ENDIF.
      ENDLOOP.
    wa_sort-spos = 1.
    wa_sort-fieldname = 'SRNO'.
    wa_sort-up = 'X'.
    wa_sort-subtot = 'X'.
    APPEND wa_sort TO i_sort.
      gd_layout-no_totalline = 'X'.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                       = ' '
         i_callback_program                        = v_repid
      I_CALLBACK_PF_STATUS_SET     = ' '
    i_callback_user_command                = 'USER_COMMAND'
      I_CALLBACK_TOP_OF_PAGE         = ' '
      I_CALLBACK_HTML_TOP_OF_PAGE  = ' '
      I_CALLBACK_HTML_END_OF_LIST    = ' '
      I_STRUCTURE_NAME                       =
      I_BACKGROUND_ID                        = ' '
      I_GRID_TITLE                                  =
      I_GRID_SETTINGS                          =
         is_layout                                      = gd_layout
         it_fieldcat                                      = i_fieldcat[]
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
         it_sort                           = i_sort
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = 'X'
      I_SAVE                            = ' '
      IS_VARIANT                        =
      IT_EVENTS                         =
      IT_EVENT_EXIT                     =
      IS_PRINT                          =
      IS_REPREP_ID                      =
      I_SCREEN_START_COLUMN             = 0
      I_SCREEN_START_LINE               = 0
      I_SCREEN_END_COLUMN               = 0
      I_SCREEN_END_LINE                 = 0
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      I_HTML_HEIGHT_TOP                 =
      I_HTML_HEIGHT_END                 =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
        TABLES
          t_outtab                          = it
       EXCEPTIONS
         program_error                     = 1
         OTHERS                            = 2
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    Regards,
    Seema

  • How to get the total number of pages printed in a report?

    Hi All,
    I have a requirement where I need to print a frame of fields only in the last page. Unfortunately I cannot use the 'Print Object On' property as it doesnt work in my case. So, I am planning to write a format trigger on the frame to return TRUE if the page is the last physical page. Now, I need to know how to get the total number of physical pages that will get printed in the report so that I can use this to manipulate the frame. I was planning to use the 'Total Physical Pages' built-in, but it seems like I can just use it to print in a field and I can't use this field's value anywhere in the plsql code (formula column function/format trigger) in the report. Is there anyway to get the total number of pages printed in the report which can be used in the report plsql code?
    Thanks,
    Srini.

    i found the solution, thanks

  • How to get the total pages in ALV report?

    Hi guys,
    Since I used page breaks can somebody please help me on how to get the total pages in ALV report?sincerely please...thanks guys.

    automatic display total page.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a415907
    r

  • How to Determine the "Total" Page Count on HP 2575 All-in-one printer?

    Looking at how to determine the "Total" Page Count on HP 2575 All-in-one printer?   I've seen directions for other HP printers but can't seem to find any for the HP 2575 All-in-one printer.  I am trying to find approximately how many pages my printer has printed since I've owned it.    Any help is much appreciated. 

    The manual says you should be able to use the Embedded Web Server to view statistics. 
    Say thanks by clicking the Kudos Thumbs Up to the right in the post.
    If my post resolved your problem, please mark it as an Accepted Solution ...
    I worked for HP but now I'm retired!

Maybe you are looking for

  • Smartforms: Automatically expand of a field

    Hello, i´ve created a smartform. In this smartform there is a field with a table. This field is filled by a report. My problem is that for espacial there is enough space for three lines in the field, but if i have 4 the last line is cut off? what can

  • AD Import using Custom Attributes?

    by default when you run AD import in UC, it fetched whole AD domain accounts which contains service accounts and a lot other stuff which one don't want to import. So choice is to search using a particular Base DN which query only one OU. But this sim

  • Error accessing Inventory Collaboration Hub (ICH) in SAPSCM4.0

    Hi, While I am trying to access the ICH page from SAP SCM4.0, am getting the following error, 500 SAP Internal Server Error Error message: Program ZSCMBMDL_LOCPROD_SERVICE not found. ( type of termination: RABAX_STATE ) The standard BSP pages in WAS

  • Message info req??

    hi i had an req like to display an message on list 1 o f any O/P,than if user wants to go to next screen,than he have to press a button,than there shd appear a I message Want to cont',if he cilks OK,it shd display list 2,if he cancel the msg,he shd s

  • Accessing Adobe Air 3.7 on Android 4.0.3 os?

    It may be simply my lack of knowledge regarding how this application is supposed to function. I found it on the Google Play market place where it appeared to be an alternative for the Adobe Flash Player. I've installed Air on my device, and I'm just