Aggregate data by tags
If you need to compare data across different values for a given tag,
you’ll want to group results by that tag. You can do so via the
Before you begin
If you don’t already have any Stream data in your workspace, you can use any Source of our Quix Library to set some up.
Get a Personal Access Token to authenticate each request.
Using the groupBy property
You can supply a list of Tags in the
groupBy array to aggregate
results by. For example, you could group a set of Speed readings by the
LapNumber they occurred on using something like:
With these settings alone, we’ll get the
LapNumber tag included in our
results, alongside the existing timestamps and requested parameters,
For meaningful aggregations, you should specify a type of aggregation
function for each parameter. When specifying the parameters to receive,
aggregationType in each parameter object like so:
Ten standard aggregation functions are provided including
spread. When you group by a tag and specify how to
aggregate parameter values, the result will represent that aggregation.
For example, the following results demonstrate the average speed that
was recorded against each lap: