Summing a column in a group

I am using Crystal XI
This report is grouped by ItemNo and I want to show a total of the Length column per ItemNo
Length needs to be a string field, SUM won't let me use a string type field and it won't let me convert
it using CDbl, Val or ToNumber.   Without going into detail, the length column must be a string - I have no control over this.
So I thought I would just do something like this:
Create a formula with this in it:
WhileReadingRecords;
NumberVar Item:= Item + Val({_WorksheetDetails.Length});
Then just place this formula field in the group area of the report.
Then somehow reset the Item after it is done with that group and before it starts the next group.
This is not working, any help would be appreciated
Thanks!
Jeff

I put a resetformula in the group footer and I have this formula suppressed.
Here is that formula:    NumberVar Item:= 0;
I have the details section suppressed and just have all the fields in the group section
As far as the formula that adds the lengths, here it is:
WhileReadingRecords;
NumberVar Item:= Item + Val({_WorksheetDetails.Length});
I am not suppressing anything else, the rows in the table are grouped by ItemNo  ...so for all the rows in the table that have the same ItemNo, I want to see the total   Length
I just added the formulas in the main Formulas list in the tree on the left... did I need to add a formula in a section expert?  ...if so, where at?
Am I leaving something out?
Thanks,
Jeff

Similar Messages

  • How to make sum of a column in Datatable grouping?

    I have done Datatable grouping and Now I want to sum 2 columns for individual groups.
    How should I do?
    In the Second Image The grouping is shown.In the second Image.
    In the first image I have expanded that group and in that I want to do sum for contribution and distribution column.
    How should I achieve It?
    Thanks in Advance.

    Hi,
    We can create a Calculated column to achieve it. The column settings as below:
    Best Regards
    Dennis Guo
    TechNet Community Support

  • How to use single column in a group by clause

    hi frs
    i hve used sum function in a sql how to use a single column in a query.
    for ex
    select sum(sal),ename,job,deptno,empno from emp
    group by deptnowhether its possible to use single column in a group by class.
    i want like this because in my custom report i need it. Report query has more than 30 column so its not possible to use 30 columns in a group by.
    pls help.
    Thanks
    Rajesh

    Maybe something like this -
    Select ename, job, deptno, empno, sal, col1, col2, col3, col4 ......, coln
    From
    Select SUM(sal) sal, deptno deptno_i
    From Emp
    Group By deptno
    ,Emp
    Where deptno = deptno_i
    Shailender Mehta

  • Sum of columns in union query

    hi, i am using oracle 10g database..
    how to get the sum of column in union query ?
         select * from (select 100 records from dual), (select 50 available from dual)
    union
    select * from (select 200 records from dual), (select 150 available from dual)
    display should be like
                     records         available
                      100               50
                      200               150
    total            300               200thanks ...

    Peter vd Zwan wrote:
    try this:Grouping by records will not produce correct results:
    SQL> with a as
      2  (
      3  select * from (select 100 records from dual), (select 50 available from dual)
      4  union
      5  select * from (select 100 records from dual), (select 100 available from dual)
      6  union
      7  select * from (select 200 records from dual), (select 150 available from dual)
      8  )
      9  select
    10    case when grouping(records) = 0 then null else 'total' end tot
    11    ,sum(records)   records
    12    ,sum(available) available
    13  from
    14    a
    15  group by
    16  rollup (records)
    17  ;
    TOT      RECORDS  AVAILABLE
                 200        150
                 200        150
    total        400        300
    SQL> select  case grouping(rownum)
      2     when 1 then 'Total'
      3   end display,
      4          sum(records) records,
      5          sum(available) available
      6    from  (
      7            select * from (select 100 records from dual), (select 50 available from dual)
      8           union
      9            select * from (select 100 records from dual), (select 100 available from dual)
    10           union
    11            select * from (select 200 records from dual), (select 150 available from dual)
    12          )
    13    group by rollup(rownum)
    14  /
    DISPL    RECORDS  AVAILABLE
                 100         50
                 100        100
                 200        150
    Total        400        300
    SQL> SY.

  • How to Merge and Sum across columns??

    Hey guys I have an interesting Problem (at least interesting to me:p). I am trying to figure out how to use numbers to collate or group certain column data and then sum the values of the grouped data. below is a snippet from my an error log i've parsed. The final step I need to do is to create a 3 column output where the values are - Error (merged), # Errors (SUM), Error Detail(merged).
    I hope this makes sense and any help is greatly appreciated.
    24900 291 Client/zimpErrVal.h
    24900 96 Client/zimpErrVal.h
    24900 82 Client/zimpErrVal.h
    15007 700 Alllocation/zsmErrVal.h
    15209 15274 Session/zapErrVal.h
    15209 228 Session/zapErrVal.h
    15209 2447 Session/zapErrVal.h
    best,
    Curtis
    Message was edited by: Curtis Wiilliams

    Well there is a lot of interesting stuff going one here. The Hidden Col formula works great when the Err Code Col is sorted. When Err Code is random, the Hidden Col repeats counts some Err Codes twice thus giving an incorrect total...
    /___sbsstatic___/migration-images/migration-img-not-avail.png
    whereas the sorted Err Code returns the values I think your formula intended
    /___sbsstatic___/migration-images/migration-img-not-avail.png
    Also for some reason I can't get the Table 2 - Col A formula to recognize Table 1 - Err Code as a reference???
    =IF(ROW()-1>MAX(Table 1 :: Hidden),"",LOOKUP(ROW()-1,Table 1 :: Hidden,Table 1::'Error Code'))
    /___sbsstatic___/migration-images/migration-img-not-avail.png
    how the heck do you post a screenshot???
    Message was edited by: Curtis Wiilliams
    Message was edited by: Curtis Wiilliams

  • Want to sort the columns while using GROUP BY ROLLUP.

    Want to order the below query using by "News' column in descending order and "Email address" column in Ascending order.
    Note: Sorting should not bring Total value to top. It is happening now.
    {code}
    SELECT decode(grouping(NVL(Client, 'NA')),1, 'Totals', NVL(Client, 'NA')) "Email (Login ID)",
    Location "Location",
    SUM(News) "News",
    SUM(Website) "Website",
    FROM VW_FX_USERDATA
    GROUP BY ROLLUP (((NVL(Client, 'NA')),Location,1, 'Totals', NVL(Client, 'NA')))
    {code}
    PLease let me know if you need any details.
    Edited by: Nagaraja Akkivalli on Sep 23, 2011 4:04 PM

    Thanks hm,
    Let me explain bit clearly.
    Say I am getting resultset as below.When I am executing above mentioned query.
    Client*        Location    News      Website       Total
    ABC        YD           9     0           4
    BCD        HB           12     7           13
    CDE        SI            1     18           3
    JNM        BI          25     0           4
    ZZZ        TI          0     221           77
    XYZ        TT          0     1           1
    Totals                      47     247           435I want it to as below. Here records are sorted in the descending order of the News Count and then Client*
    Client*        Location    News      Website       Total
    JNM        BI          25     0           4
    BCD        HB           12     7           13
    ABC        YD           9     0           4
    CDE        SI            1     18           3
    XYZ        TT          0     1           1
    ZZZ        TI          0     221           77
    Totals                      47     247           435If I order the column by News in the descending order, it is taking Totals value to the top. (Since I am using GROUP BY ROLLUP).
    Note: Sorting should not be applied to Totals.
    Hope this is clear to you. Let me know if you need any details.
    Thanks and Regards
    Nagaraja Akkivalli.

  • How to get the last vaue of an amount column in the group above

    Hi All,
    I have a requirement
    In my report there are 3 gruops in data model.
    1.accout flex field
    2.balance
    3. journal entries
    3. JE contans debit,credit and the running total.
    My requirement is to print the final total in the frame above the repeating frame.
    Please help me in this case as to how can i achieve this requirement?
    Thanks
    Jana.

    If you have any column in JE group, you can not print that directly in 'balance' group or between repeating frames of the JE and balance. It has to be in JE or any group below JE.
    You can try what i suggested earlier. It would give you the last total of the journal. And you can place the field near to the repeating frame of JE.
    Hope this helps.

  • How to sum the column in a table seperated by sign.

    How to sum the column in a table separate by sign.
    For Example:
    A B
    10 MOHAN
    -15 KUMAR
    -25 MARCH
    50 MAY

    SELECT  SUM(CASE SIGN(A) WHEN 1 THEN A ELSE NULL END) SUM_POSTIIVE,
            SUM(CASE SIGN(A) WHEN -1 THEN A ELSE NULL END) SUM_NEGATIIVE
      FROM  tbl
    /SY.

  • How to Suppress Report Total When Using Sum on Columns & Break Formatting

    I need to know how to NOT show the report total line when using the sum functionality with a break in a report.
    I am summing two columns, a debit amount and credit amount. I am breaking on the first column which is the level of a hierarchical query. I want to see something like this:
    Parent Record xxxxxxxxxxxxxx
    Parent Sum $$ $$
    Child Record xxxxxxxxxxxxxx
    Child Record xxxxxxxxxxxxxx
    Child Sum $$ $$
    However, when I run the report, I also get a report total line under the child sum which is really meaningless for this report.
    I have also tried creating this report as an interactive report. When applying the sum on the two columns, I do get the sum totals on the break only - no report total - however, it is reversing the order of the hierarchical query results putting the child records first and the parent records second.
    Thanks in advance for your help.

    Hi, and welcome!
    I don't think that there's an easy way to "switch off" the Total line on a report. The nearest I could suggest would be to either hide the entire row or colour the text so that it's the same as the background - either way, the total is calculated but the user won't see it.
    If you put something like the following into your report region's Region Footer:
    <script type="text/javascript">
    var outertable = document.getElementById("#REGION_ID#");
    var innertable = outertable.getElementsByTagName("TABLE")[1];
    var rs = innertable.rows;
    var lastrow = rs[rs.length-1];
    if (lastrow.cells[0].innerHTML == '<b>TOTAL</b>')
    rs[rs.length - 1].style.display = "none";
    </script>Then, on your report's Report Attributes page, scroll down to the Break Formatting section and put TOTAL into the "Display this text when printing report sums" setting. Also, in the "Layout and Pagination" section, set "Enable Partial Page Refresh" to No.
    The above code is based on the report and region templates that I'm using here: [http://apex.oracle.com/pls/otn/f?p=267:147] (Theme 18, "Report Region" region template and "Standard" report template). Your report may use different templates, so the first two lines on the code may have to change. #REGION_ID# would be replaced with the region's ID value (which would be "R" followed by a long number). As long as you can identify the HTML tag that uses this ID value, you can then get to the actual table that contains the data as it would be a TABLE within that tag - the [1] above is the second table within the region. In some instances, you may have to use "region_#REGION_ID#" as the starting point.
    Andy

  • More than 1 column in the group by clause

    DB Version:10gR2
    I understand the basics of GROUP BY clause. I have a question on why we have on more than 1 columns in GROUP BY clause.
    In the below example, the course name by itself does not make up a group. A Course name plus its BeginDate make up a group. This is the whole point of having more than 1 columns in the GROUP by clause. Right?
    SQL> select r.course, r.begindate , count(r.attendee) as attendees
      3   from registrations r
      4   group by r.course, r.begindate
      5   order by course
      6  /
    COURSE BEGINDATE      ATTENDEES
    JAVA    12/13/1999           5
    JAVA    2/1/2000             3
    OAU     8/10/1999            3
    OAU     9/27/2000            1
    PLS     9/11/2000            3
    SQL     4/12/1999            4
    SQL     10/4/1999            3
    SQL     12/13/1999           2
    XML     2/3/2000             2

    ExpansiveMind wrote:
    Thanks Dmorgan. I am just learning the basics of GROUP BY clause. I have noticed that all Non-aggregate columns in SELECT list have to be present in the GROUP BY clause. I thought it was a "syntactical requirement". Now, i realise that these columns are present in the GROUP BY clause because only a combination of columns make up a group.Well, it is a bit of both actually. It is a syntactic requirement that all non-aggregated columns in the select list must appear in the group by clause. However, the non-aggregated columns in the select list is what defines your group. Your two examples define two different groups, and would answer two different questions.
    John

  • Can I know the name, type, total number of column in Record Group?

    I created a record group with query dynamically.
    And then populated it.
    I don't know the column' count, type, name befause I get the query from user at runtime.
    Can I know the name, type, total number of column in Record Group?

    Unfortunately, there is no way to query the record group (RG) to get the metadata you are looking for. RGs are best used as data sources to an LOV or List Item rather than as an Array to hold the resultset of a dynamic query. For this, I would recommend you use a Collection type of construct (PL/SQL Table of Records, VArray, etc).
    Craig...

  • How to sum a column in SQL server??

    How do I sum a column called 'expenditureamount' in a sql table 'expenditureform', such that I get the total expenditure amount displayed in a text box??

    You can sum it with the SQL SUM function, of course, but what that has to do with how your program display that sum, I don't know. IOW, how you display is not anything related to JDBC, and how you SUM it is not anything related to JDBC. The first one is SQL (check on an SQL forum or Google for it) and the second depends on how you want to display it, and there are more appropriate forums than the JDBC one, for that.

  • How to sum subgrid column in CRM 2013

    Hi,
    I want to sum Subgrid column named "Quantity" and show in alert.

    Hi,
    You can also try this code to calculate subgrid amount total for crm 2013.
    Add your subgrid name in place of "testing"  and amount field name in place of 'new_amount'.
    function RetrieveSubGridRecords() {
        if (document.getElementById("testing")) {
            var grid = document.getElementById("testing").control;
            var ids = grid.get_allRecordIds();
            var sum = 0.00;
            var cellValue;
           for(i = 0; i < ids.length; i++) {
               var cellValue = grid.getCellValue('new_amount',ids[i]);
               var number = Number(cellValue.replace(/[^0-9\.]+/g,""));
               sum = sum + number;
           alert('s'+sum);
        else {
           setTimeout("RetrieveSubGridRecords();", 2500);
    Hope this help..
    Thanks

  • Sum 2 columns in alv report (not separately)

    Hi,
    I have an alv report and I use do_sum = 'X' in order to sum separately 2
    columns.
    The demand here is that at the end of the report there will also be
    a total of the 2 columns together.
    I tried to implement it but so far - no success.
    Mayby someone has an idea ??
    Promise to award points...
    Thanks.
    Ruthie.

    Hi,
    For summing say column EBELN, MATNR for eg.
      fieldcatalog-fieldname   = 'EBELN'.
      fieldcatalog-seltext_m   = 'Purchase Order'.
       fieldcatalog-outputlen   = 10.
      <b>fieldcatalog-do_sum      = 'X'.</b>
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
    fieldcatalog-fieldname   = 'MATNR'.
      fieldcatalog-seltext_m   = 'Material Number'.
      <b>fieldcatalog-do_sum      = 'X'.</b>
      append fieldcatalog to fieldcatalog.
      clear  fieldcatalog.
    You will get the sum at the end also, try this.

  • Can you sum a column in FormsCentral?

    Similar to how you would sum a column of numbers in a Excel spreadsheet, Can you sum a column in FormsCentral or are you required to only do this once it has been saved to an Excel sheet?
    Regards
    kevin

    One of my biggest grievances with Forms Central is the lack of any kind of calculating (living in hope Adobe!)... you will have to do it in Excel.

Maybe you are looking for

  • IOS 6 Gamecenter ID did not require email address. iOS 7 does, how do I sync Game Center on new device

    My kid's have 3 iPod Touch's, 4th gen running iOS 6. We all share one Apple ID for purchases, but they each have their own Game Center ID. iOS6 Game Center DID NOT require an email address to use. Now I have bought them all iPad mini's that are runni

  • Weird "date change" glitch...?

    I had a bunch of pictures with the wrong dates, but only off by a couple of days... so, thinking I was smart I tried to "merge" the events. Obviously, that didn't change the dates. So, in the new events I tried to select all the pics and changed the

  • Setting first visible row in Web Dynpro ALV in Releases above 7.0

    Hello Everybody, I have an ALV in which a particular row should be set to lead selection and also set as the first visible row in this ALV for the first display. The index for this row is determined at runtime. I used the method SET_FIRST_VISIBLE_ROW

  • Is there a spam email from Whats App?

    Anyone having a problem with their email/phone/passwords?

  • Compatible Smart Cards

    Hello everyone, Hopefully you can help me out with the following. I have windows 7 clients and a windows server 2012 r2 server running PKI. I recently ordered an omni card reader 3121. I als bought several smart cards like the CHIP SLE 4428 and the C