method Aggregates.Add (Key as String, Base as Variant, [Name as Variant], [Caption as Variant])
Adds an Aggregate function and returns a reference to the newly created object.

TypeDescription
Key as String A String expression that specifies the unique key to identify the Aggregate object. The Key parameter should include only alpha-numeric characters. Any other characters are not included. The Key property specifies the Aggregate's key.
Base as Variant A String expression that defines the base aggregate function to be used by the Aggregate object. The valid values are: "sum", "min", "max", "count" or "avg". Any other value makes the Aggregate object to be shown as disabled when showing in the control's context menu.
Name as Variant A String expression that indicates the HTML caption to be shown on the control's context menu
Caption as Variant A String expression that indicates the HTML caption to be shown on the column's header.
ReturnDescription
AggregateAn Aggregate object being created, that holds the newly object.
The Add method adds an Aggregate object to the Aggregates collection. An aggregate function is a function where the values of multiple rows are grouped together as input on certain criteria to form a single value of more significant meaning or measurement such as a set, a bag or a list. The Aggregate object is identified by an unique key. By default, the Aggregates collection contains the "sum", "min", "max", "count" or "avg" Aggregate objects. Use the FormatValue/FormatResult property to convert/format the value/result of the Aggregate function. The PivotColumns or PivotTotals property to display aggregate functions on the columns. 

The Aggregate objects are shown on the control's context menu as shown bellow:

 

The Base parameter could be one on the following: