### SummaryFunction (fld)

Basic and Crystal syntax.

##### Arguments

fld is any valid database or formula field that can be evaluated by the function.

##### Returns

Fractional Number.

##### Action

SummaryFunction (fld) summarizes the values in the specified field for the entire report. It generates, in effect, a "grand total" summary.

##### Typical uses

Use these functions any time you need to summarize all the values that appear in a given field in a report, or when you need to use a summary in a calculation or comparison.

##### Examples

The following examples are applicable to Crystal syntax:

`SummaryFunction({orders.ORDER AMOUNT})`

Summarizes all values in the Amount field.

If {orders.ORDER AMOUNT} > SummaryFunction({orders.ORDER AMOUNT}) Then
"Flag"
Else
""

Compares each value in the Amount field to the summary value of all values in the Amount field. If the value is greater than the summary value, it flags it with the word "Flag"; if it is equal to or less then the summary value, it prints nothing.

`Average({orders.ORDER AMOUNT})`

Calculates the average of all values in the Amount field.

If Count({orders.ORDER ID}) >= 100 Then
"Congratulations on meeting your quota!"
Else
""

Prints the congratulatory message if the number of orders is 100 or more, and prints nothing if the number of orders is less than 100.

`Sum({file.QTY})`

Calculates the sum of all values in the QTY field.

##### Comments

Not all arithmetic group functions are available for use with all data types.

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