Aggregate functions provide a powerful means to analyze your records, but they are not relevant for all field types. For example, using an aggregate function on a base64 field type would not return meaningful data, so base64 fields do not support any of the aggregate functions. The following table lists support by the aggregate functions for the primitive data types.
| Data Type | AVG() | COUNT() | COUNT_DISTINCT() | MIN() | MAX() | SUM() |
|---|---|---|---|---|---|---|
| base64 | No | No | No | No | No | No |
| boolean | No | No | No | No | No | No |
| byte | No | No | No | No | No | No |
| date | No | Yes | Yes | Yes | Yes | No |
| dateTime | No | Yes | Yes | Yes | Yes | No |
| double | Yes | Yes | Yes | Yes | Yes | Yes |
| int | Yes | Yes | Yes | Yes | Yes | Yes |
| string | No | Yes | Yes | Yes | Yes | No |
| time | No | No | No | No | No | No |
In addition to the primitive data types, the API uses an extended set of field types for object fields. The following table lists support by the aggregate functions for these field types.
* Calculated fields are custom fields defined by a formula, which is an algorithm that derives its value from other fields, expressions, or values. Therefore, support for aggregate functions depends on the type of the calculated field.