--- title: "Aggregation" slug: "aggregation" updated: 2025-08-28T07:52:35Z published: 2025-08-28T07:52:35Z canonical: "learn.servitly.com/aggregation" --- > ## Documentation Index > Fetch the complete documentation index at: https://learn.servitly.com/llms.txt > Use this file to discover all available pages before exploring further. # Aggregation Apply an aggregation function to the values of a metric. This algorithm takes as inputs the values of a metric, and apply to them one of the following aggregation functions: - ***Minimum***: the minimum value is returned. - ***Maximum***: the maximum value is returned. - ***Average***: the average value is returned. - ***Delta***: the difference between the last and the first value of the metric. ## Inputs Here is the list of inputs required by this Algorithm. | | INPUTS | | --- | --- | | *Metric* | The base metric whose values must be aggregated. Type: METRIC **\|** Mandatory **\|** Dataset Range: Last 24 hours | | *Function* | The function used to aggregate values. Type: SELECTION **\|** Mandatory **\|** Values: MIN, MAX, AVG, DELTA | ## Outputs Here is the list of outputs provided by this Algorithm. | | OUTPUTS | | --- | --- | | *Aggregate Value* | The value of the aggregation function calculated on the input metric values over the past 24 hours. Type: FLOAT | | *Aggregate Value with Timestamp* | The value of the aggregation function calculated on the input metric values over the past 24 hours. The value is saved using the timestamp of the first occurrence of the minimum or maximum value. Note that, this output is valid only for `Minimum` or `Maximum` aggregation. Type: FLOAT | ## Insight Metric Configuration To use this Algorithm in an [Insight Metric](/docs/insight-metrics), you need to: 1. Go to the *Insight / Insight Metrics* page. 2. Select the *Thing Definitions* tab. 3. Select the Thing Definition where to create the insight metric. 4. Click the Add Metric button. 5. Select the *Aggregation* algorithm. 6. Select the output for which you want to calculate the metric.