An aggregate function is a calculation that is performed on multiple values in a given time interval, and returns a single value. You can determine the interval by setting a time range for the dashboard.
This is important because the values are compressed when they are displayed in a widget. Presenting each individual value would give an unclear and complex picture, from which it is difficult to draw conclusions. There is usually more interest in knowing whole figures than in details. When you zoom in on the widget timeline, you'll see more individual data points.
Examples
Let's say a sensor measures water consumption in liters. Within a time interval, it emits the following values:
1 1 2 0 1 0 2 3
Depending on the aggregation set, your widget will display the following value:
Aggregation | Displayed value | Statement |
|---|---|---|
COUNT | 8 | The number of values sent in the time interval. It works on numeric values as well as on strings (text). |
AVG | 1.25 | The average value in the time interval. It is usually used to get an overview of a situation, or when it is important to know averages. |
MAX | 3 | The largest value it has received in the time interval. Useful if you check an upper limit, for example. |
MIN | 0 | The smallest value in the time interval. Useful if you check a lower limit, for example. |
FIRST | 1 | The first value received in the time interval. |
LAST | 3 | The last value received in the time interval. |
DIFF | 2 | The difference between the first and the last value in the time interval. This feature is useful when you are counting totals, and you want to know the increase or decrease in your values. |
SUM | 10 | The sum of all values received in the time interval. This feature is useful when your sensor is a counter, for example, and you want to know totals. |
If you do not select an aggregation, it will default to LAST.
Attention!
To know when to use SUM or DIFF, it's important to understand the way your sensor measures the value.
If you get the following values: 1 1 0 2 you can use SUM to get the total of the measured values. The calculation looks like this: 1 + 1 + 0 + 2 = 4
If you get the following values: 1 3 6 5 the sensor will add up the measured values. You can also use DIFF to know by how much the values have changed. The calculation looks like this: 5 - 1 = 4
How to use aggregation in widgets
When setting up a widget, you can define the maximum number of data points to be displayed. Data points are the values that a sensor sends to the portal. Over time, these values are compressed for clarity. The compression of the data points is controlled by the Max Data Points setting. The higher you set this maximum, the more points will be displayed on your widget, and the less they will be compressed.
Line chart
This is a line chart with data from a single sensor (Phase A Current), repeated three times, but with different aggregations:
The dark blue line shows the maximum (#MAX) value.
The light blue line shows the average (#AVG) value.
The green line shows the minimum (#MIN) value.
.png?sv=2022-11-02&spr=https&st=2025-11-13T11%3A11%3A44Z&se=2025-11-13T11%3A24%3A44Z&sr=c&sp=r&sig=O2aNJIYzRMmde9gBJgJPI2NruJLkTgcJwyEdu1qkNqI%3D)
Bar chart
This is a bar chart with data from a single sensor (Run Hours Absolute).
Because the values are incremental in nature, a #DIFF aggregation is used to get an overview of the running hours, with a fixed interval of 1 day.

Single Block
This is a single block displaying the gas consumption in a given period.
Because the values originate from a pulse counter, a #SUM aggregation is used to count the total number of pulses, to get the amount of gas consumed in a period.

And a single block displaying the last known address of an asset.
Because the value is not a numerical value, but of type string, a #STR_LASTKNOWN aggregation is used, to get the last known address.
