Aggregates
Last updated
Last updated
Aggregates are used to create now derived data from incoming data. For example take the sum of multiple tags their measurements average in the last 7 days. Complex operations are possible here. The result of the aggregate will a device with a single tag name and serial starts with AG-.....
A aggregate can be created in a workspace with inputs from that same workspace.
An aggregate consists of one or more rows. Every aggregate row is basically an input for further on computation in the aggregate. Execution of the aggregate occurs in two phases.
Execution phase 1 The aggregate goes over every row it has and gets and processes the data as decribed. This could for example be getting the average value of the last 10 minutes of datapoints from some temperature tag. Execution only proceeds to phase 2, if all rows have fresh (meaning nog previously processed) values.
Execution phase 2 With the data resulting from every row, another operation or formula application can be done. This could for example be the following. There is an aggregate with two rows, temperature average and windspeed average. These two averaged values of the two rows may now be put into a formula via placeholders or could again be averaged.
Placeholders Every aggregate row has a placeholders. These are only relevant if the final operation is a formula instead of a standard operation like avgerage or sum. In case of using the formula, every row computes into a value, lets say average of temp over last 10 min could be placed into a placeholder like avgTemp10Min. This value will then be placed into the formula.
Operations The aggregate itself and its rows can have various types of operations. These can be seen as basic ways of transforming / computing measurement data of tags into new data.
Example For example a average temperature is required. Setup 1 row with the temperature tag selected. In the row choose time offset and time offset of 10 minutes and select operation average. After this the row is basically setup, but we should set the aggregate operation to latest to just select the one value resulting from the temperature average row.
There are some options for measurement offsets for every aggregate row. The main two are time and count offset
The time offset is used to get measurements within a certain timeframe. For example the last 10 minutes or last day. There are also different options like this day and this week. To understand the difference let look at the following example to with a 1 day offset and a this day offset. 1 Day offset Every time the aggregate runs it will basically take the last 24 hours of measurements. This could for example be from now @ 15:00 back till yesterday 15:00 This day offset Every time the aggregate runs it will take the measurements starting for the beginning of the day. Like from now @15:00 back till 00:00.
Simply takes the last i.e 10 or 100 measurements.
Please check page for creating formulas with placeholders.