groupBy
Introduction¶
A GroupBy Query groups a set of events by a set of dimensions and aggregates them by a set of metrics. It is slightly more complicated than the Top N query, but allows more flexibility and more complex queries. This is the proper query type if you want to group your data by multiple criteria.
Core Concepts & Examples¶
Following you can find additional information and a practical example.
Use Case: System Versions and Model Names
Explanation: A query to group events TelemetryDeck.Session.started regarding the dimensions for System Major Version and Model Name. The dimensions are unchanged and thus the type default used.
Currently, the data returned with this query type can only be displayed in table format. Example:
{
"aggregations": [
{
"name": "Number of Events",
"type": "eventCount"
}
],
"dimensions": [
{
"dimension": "TelemetryDeck.Device.systemMajorVersion",
"outputName": "Major System Version",
"outputType": "STRING",
"type": "default"
},
{
"dimension": "TelemetryDeck.Device.modelName",
"outputName": "Model Name",
"outputType": "STRING",
"type": "default"
}
],
"filter": {
"dimension": "type",
"type": "selector",
"value": "TelemetryDeck.Session.started"
},
"granularity": "all",
"queryType": "groupBy"
}
Property Reference¶
Here is a detailed overview of all available properties for GroupBy Queries.
Property: queryType
Description: for this type has to be 'groupBy'.
Required: true
Property: dataSource
Description: defaults to namespace, should usually not be changed.
Required: false
Property: relativeIntervals
Description: see also respective section; the time intervals to query, specified as relative to time of query (if neither relativeIntervals nor intervals are set, the time period of the date picker in the dashboard is applied).
Required: false
Property: intervals
Description: a JSON Object representing ISO-8601 Intervals. This defines the time ranges to run the query over, specified as absolute time intervals (if neither relativeIntervals nor intervals are set, the time period of the date picker in the dashboard is applied).
Required: false
Property: granularity
Description: see also respective section; defines the granularity of the query. Potential values are 'hour', 'day', 'week', 'month', 'quarter', 'year' and 'all'.
Required: true
Property: filter
Description: see also respective section; a filter that is applied to the query.
Required: false
Property: virtualColumns
Description: see also respective section; if created a JSON list of virtualColumns can be referenced in aggregations or postAggregations.
Required: false
Property: aggregations
Description: see also respective section; a list of Aggregators to apply to the query, provides the option to aggregate data.
Required: false
Property: postAggregations
Description: see also respective section; a list of Post-Aggregators to apply to the query, which provides the option for further actions on aggregated data.
Required: false
Property: dimensions
Description: a JSON list of dimensions to do the groupBy over. For more info and possibilities, see also section DimensionSpecs.
Required: true
Property: context Description: see also respective section; a QueryContext object that specifies how the query is calculated and cached. Required: false