Sum

The Sum function computes the total for a column of numbers.

Sum (numbers, break_col, break_value)

where:

numbers references the column that contains the numbers on which the sum is calculated.

break_col is an optional parameter that references a break column.

break_value is an optional parameter that returns the sum of numbers column where value in break_col equals break_value.

Note:

If constant values in the break_value column are substituted for data items, dates and text strings must be enclosed in single quotes.

The following examples show the results of inserting the Sum function in two separate tables.

Example 1

In this example, the Sum function is used on the numeric column. The results are shown in the Computed column.

Sum(Amount)

Table 169. Sum Example 1

StateCityAmount Computed
AZTucson1121556
CABurbank2401556
CAGlendaleNULL1556
FLPalmetto701556
MD Laurel971556
MIDetroit2081556
MNEagan1591556
NYNew York4901556
NYRochester1801556

Example 2

In this example, the Sum function has been inserted for the numeric column and break_column using the following definition:

Sum (Amount,State)

The results are shown in the Computed column.

Table 170. Sum Example 2

StateCityAmountComputed
AZTuscon112112
CABurbank240240
CAGlendaleNull240
FLPalmetto7070
MDLaurel9797
MIDetroit208208
MNEagan159159
NYNew York490670
NYRochester180670