Results 1 to 2 of 2

Thread: Group sum not working right

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2004
    Posts
    3

    Group sum not working right

    I have a simple report that I am trying to produce. I am trying to display an product code and the number of cases for that product in inventory. And a total for all the items. I have built a formula field (nbr_items) to calculate the number of items :

    if {C_MVT_H.MVT_EFF_TRANS_DATE} - {?Start_Date} < 0
    and {C_MVT_H.MVT_EFF_TRANS_DATE} <= {?End_Date} then
    if {C_MVT_H.MVT_TRANS_TP} = 'CR'
    or {C_MVT_H.MVT_TRANS_TP} = 'CO'
    or {C_MVT_H.MVT_TRANS_TP} = 'A'
    or {C_MVT_H.MVT_TRANS_TP} = 'BF'then
    {C_MVT_H.MVT_UNIT}
    else
    0
    else
    0

    And another to calculate sum (sum_nbr_items) :

    sum({@Nbr_Items})

    I put the sum_nbr_items in a group header section that breaks on item code. This works when I only have one item, but when I have more that one, it creates a seperate group for the other item which is right, but then sums both items up.

    Any help, documentation, anything is helpful. I am new to this crystal reports thing.

  2. #2
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758
    The Sum formula needs to specify a group field as well. When the group changes the value is then reset to 0.


    sum({@Nbr_Items}, {TableName.FieldName} )

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width