The Sum function computes the total for a column of numbers.
Sum (numbers, break_col, break_value)
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.
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.
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
State | City | Amount | Computed |
---|---|---|---|
AZ | Tucson | 112 | 1556 |
CA | Burbank | 240 | 1556 |
CA | Glendale | NULL | 1556 |
FL | Palmetto | 70 | 1556 |
MD | Laurel | 97 | 1556 |
MI | Detroit | 208 | 1556 |
MN | Eagan | 159 | 1556 |
NY | New York | 490 | 1556 |
NY | Rochester | 180 | 1556 |
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.