### SummaryFunction (fld, condFld, cond)

Basic and Crystal syntax.

##### Arguments

- fld is any valid database or formula field that can be evaluated by the function.
- condFld is any valid date or Boolean field used to group the values in fld by.
- cond is a text string indicating the condition of condFld that controls grouping. Valid strings for this argument depend on whether condFld contains date or Boolean values. For information about the available conditions, see Conditions for summary functions.

##### Returns

Fractional Number

##### Action

SummaryFunction (fld, condFld, cond) summarizes each group of values that is generated when the specified summary condition is met. These functions work just like SummaryFunction (fld, condFld), but, because they use a date or Boolean field as a sort and group by (trigger) field, they require a condition in addition to the other arguments.

##### Typical uses

Use these functions whenever you want to duplicate, in a formula, a summary:

- that summarizes the values in a group
- that uses a date or Boolean field as the sort and group by field.

##### Examples

The following examples are applicable to both Basic and Crystal syntax:

`SummaryFunction({orders.ORDER ID}, {orders.ORDER DATE}, "monthly")`

Summarizes the orders in each group of orders in the Orders field. The orders are separated into groups whenever the value in the Date field changes to a new month.

`Count({orders.ORDER AMOUNT}, {orders.ORDER DATE}, "monthly")`

Counts the number of orders in each group of orders in the Amount field (the total orders for each month). The orders are separated into groups whenever the value in the Date field changes to a new month.

`DistinctCount({orders.CUSTOMER ID}, {orders.ORDER DATE}, "weekly")`

Counts the number of different customers contacted, follow up contacts are excluded. Customers are separated into groups whenever the value in the Date field changes to a new week.

The following example is applicable to Crystal syntax:

`(SummaryFunction({orders.ORDER AMOUNT}, {orders.ORDER AMOUNT}, "monthly")) % (SummaryFunction({order.ORDER AMOUNT}))`

Groups values in the Amount field by month, summarizes the values for each month group, and shows those values as a percentage of the summary value for the entire report.

##### Comments

In order to use these functions to insert a group field in a formula, you must have already entered a group field in your report with identical parameters: same field, same sort and group by field, same date or Boolean condition, same action (average, count, etc.).

Seagate Software, Inc. http://www.seagatesoftware.com Please send comments to: techpubs@seagatesoftware.com