Crystal Reports for Eclipse Designer Guide

Sum

Description
Enables you to add the values that appear in your report.
Overloads
  • Sum (fld)
  • Sum (fld, condFld)
  • Sum (fld, condFld, cond)
  • Sum (x)
  • Returns
    Number
    Action
    Enables you to add the values that appear in your report. For example:
  • If a sales report includes a field that shows the amount of each order, you can compute the sum of all the orders that appear on the report (a grand total sum).
  • If you break orders into groups (for example, orders grouped by the state that they come from), you can compute the sum of the order amounts per group (in this case, per state).
  • If you break orders into date or Boolean groups (for example, orders grouped by the month in which they were placed), you can compute the sum of the order amounts per group based on a specific change in the date or Boolean field (in this case, per month).
  • If you specify a set of individual values, you can also compute the sum of the values in the set. For information on this kind of summary, see Array summary functions.
  • Examples
    Sum({file.QTY})
    Calculates the sum of all values in the QTY field.
    >Sum({orders.AMOUNT}, {orders.CUSTOMER ID})
    Sums (totals) the orders in each group of orders in the Amount field. The orders are separated into groups whenever the value in the Customer ID field changes.
    Sum({orders.AMOUNT}, {orders.DATE}, "monthly") % Sum({orders.AMOUNT })
    Groups values in the Amount field by month, and calculates the sum of the values for each month group as a percentage of the sum of the values for the entire report.
    Sum([{file.AMOUNT}, {file.PRICE}, {file.COST}])
    Sum of values in the Amount, Price, and Cost fields.
    Using this function in a formula forces the formula to be evaluated at print time. For more information on evaluation time considerations, see the Evaluation Time.



    SAP BusinessObjects
    http://www.sap.com/sapbusinessobjects/
    Support services
    http://service.sap.com/bosap-support/
    Product Documentation on the Web
    http://help.sap.com/