User guide

Operator reference
108 Data Integration with Sybase Avaki Studio
“Select” on page 165
“Splitter” on page 166
“Union” on page 168
“Update” on page 169
Aggregate
The Aggregate operator condenses a multi-row result set into one with a single row by
applying any of a number of functions to the data. These functions perform calcula-
tions such as totalling or counting the values for each row. The output row has one col-
umn containing the result of each function defined. The functions are commonly used
to operate on the contents of a single column from the input result set, but the parame-
ter passed to them can actually be the result of an arbitrary JavaScript expression,
allowing more complex calculations. The functions which Studio supports for aggre-
gation are Sum, Average, Maximum, Minimum, Count, First, Last, Population Vari-
ance, Sample Variance, Population Standard Deviation, and Sample Standard
Deviation.
For example, if you have a result set with a column called SALARY containing each
employee’s salary, you can define a new column using an Aggregate operator which
calculates the total salary for all rows in the result set using the Sum function and pass-
ing the value SALARY as the corresponding expression.
Note that the original columns from the input result set are not carried through to the
output of the Aggregate operator, only the newly computed ones.
Connections
The Aggregate operator takes exactly one input result set, which can be the output of
an Input Source or of any other operator. It produces exactly one output result set
whose schema is defined by the operator.
Required Connection