This topic provides the syntax for the <views> element of a Query API SOAP request.
The <views> element defines a view on a property or dimension property of an event, or on an aggregate of either. For each <views> element there is a column added to the result set. There may be multiple <views> elements.
There are three elements contained by the <views> element:
Element | Description |
---|---|
<dimension> | The name of a dimension associated with the event. Each <views> element may have at most one <dimension> element. |
<property> | The name of a property associated with the dimension. Each <views> element must have one and only one <property> element. Note:
There is a special case usage of the <property> element: <views> <property>*</property> <aggregate>1</aggregate> </views> This special case results in a count of events that meet the criteria of the rest of the query. |
<aggregate> | The method of aggregation for this view. This is an optional element and takes an integer value. For details on the values used by the <aggregate> element, see the following table. |
Value | Description |
---|---|
0 | No aggregation. This is the same as omitting the <aggregate> element. |
1 | Count. A count of all distinct properties in the view. |
2 | Min. The property with the minimum value in the view. For string values, this is the alphabetically earliest property. |
3 | Max. The property with the maximum value in the view. For string values, this is the alphabetically latest property. |
4 | Average. An arithmetic average of the properties in the view. This only applies to numeric properties. |
5 | Sum. The sum total of the properties in the view. This only applies to numeric properties. |