Page History
Table of Contents | ||
---|---|---|
|
Overview
Description | Retrieving aggregated values of given records |
Resource Path |
|
HTTP Method | POST |
Request/Response Format | application/json |
Authentication | Basic |
Parameter description
Parameter | Description |
---|---|
tableName | The name of the event table for which this query should be run. |
parentPath | This specifies whether the aggregate should be calculated for a child category within a specific category. When you specify a parent path, everything that is not included in that path is ignored when the groupBy operation is executed. Therefore, this parameter also plays the role of a filter. |
aggregateLevel | This specifies the level up to which the aggregation should be done. This is specified relative to the parent path. |
groupByField | This represents the GROUP BY equivalent in SQL, and specifies the field by which the retrieved values should be grouped. |
aggregateFields | This is an array of JSON objects. Each object represents the field that you want to aggregate.
|
Example
Code Block | ||
---|---|---|
| ||
GET https://localhost:9443/analytics/aggregates { "tableName":"test2", "parentPath": [], "aggregateLevel": 0, "groupByField":"facet", "aggregateFields":[ { "fieldName":"n", "aggregate":"AVG", "alias":"result_avg" }, { "fieldName":"n", "aggregate":"MAX", "alias":"result_max" }] } |
Sample output
Code Block | ||
---|---|---|
| ||
[{ "id":"14399961246350.13125980939205978", "tableName":"test2","timestamp":1439996124610, "values":{ "result_avg":"20", "result_max":"22", "single_valued_facet_field":[engineering] //This should be a facet with a single value. } }, { "id":"14399961246350.13125980939205999", "tableName":"test2","timestamp":1439996124610, "values":{ "result_avg":"34", "result_max":"46" "single_valued_facet_field":[marketing] //This should be a facet with a single value. } } ] |
REST API response
...
HTTP status code | 200 For descriptions of the HTTP status codes, see HTTP Status Codes. |
Overview
Content Tools
Activity
