Skip to content
© 2026 The ThingsBoard Authors
Try for free

ThingsBoard Cloud

Choose your data region

Your data stays in the region you choose, for residency and compliance. No credit card required.

Rather run it yourself? Install on your own servers

Time Series Data Aggregation

Time series data aggregation computes aggregated metrics over historical telemetry of the current entity at fixed time intervals (hourly, daily, weekly, monthly, etc.) and stores the results as new telemetry keys. For example, an energy meter can automatically generate energyHourlySum, powerHourlyAvg, and powerHourlyMax at the end of each hour.

Unlike Related entities aggregation (which aggregates across multiple entities at the latest point), this type operates on historical windows of a single entity’s data — ideal for analytics, reporting, and long-term KPIs.

Use Time series data aggregation when you need to:

  • Generate hourly/daily/weekly aggregates (e.g., hourly average temperature)
  • Build KPIs from historical data (daily runtime, peak load, total consumption)
  • Pre-aggregate metrics to reduce dashboard and API load
  • Track near-real-time aggregates using intermediate results (e.g., “current hour average so far”)
  • Handle delayed telemetry — the system recalculates affected intervals when late data arrives
  1. Open the Data processing ⇾ Calculated fields page.
  2. Click the + Add calculated field ⇾ Create new calculated field in the top-right corner.
  3. In General, enter a title, specify the entity the field applies to, and select the Time series data aggregation type.
  4. Configure Arguments, Metrics, Aggregation interval, and Output.
  5. Click Add to save.

This type reads historical telemetry from the current entity only — Latest telemetry is the only available argument type.

Click Add argument and fill in:

Field Description
Time series key The telemetry key whose data will be aggregated (e.g., temperature, power)
Argument name Variable name referenced by metrics

Each metric produces one output telemetry key per interval.

Click Add metric and configure:

Field Description
Metric name Output key name (e.g., tempAvg, energyHourlySum)
Aggregation Average, Min, Max, Sum, or Count
Argument name The argument whose values are aggregated
Default value Used when the interval contains no data

You can create multiple metrics from the same argument (e.g., tempAvg, tempMin, tempMax).

Defines how often aggregation runs and how time boundaries align.

Setting Options
Aggregate interval type Hour, Day, Week (Mon–Sun), Week (Sun–Sat), Month, Quarter, Year, Custom
Time zone Aligns boundaries for daily/weekly reports and region-specific KPIs

Aggregation results are stored with the timestamp corresponding to the start of the aggregation interval (e.g., an hourly aggregate for 01:00–02:00 is stored with the 01:00 timestamp).

Advanced interval options:

Option Description
Apply offset Shifts interval start by a fixed offset (like +10 min → 00:10, 01:10, etc.). Useful when telemetry arrives slightly after boundaries.
Apply await timeout How long the system waits for late telemetry after an interval ends. Late telemetry received within the await timeout triggers recalculation for accuracy.
Produce intermediate result Calculates and stores aggregates for the current (unfinished) interval, updated at most every 5 minutes. Useful for dashboards showing “current hour so far”.

Apply offset

Apply await timeout

Produce intermediate result

Results are stored only as time series under the configured metric names.

For output strategy options, see Calculated Fields — Output Strategy.


An Energy Meter 1 device publishes power (kW) and energy (kWh) telemetry continuously. Goal: compute hourly KPIs and store them as new time series keys:

  • energyHourlySum — total energy consumption per hour
  • powerHourlyAvg — average power per hour
  • powerHourlyMax — maximum power per hour
  1. Apply the Time Series Data Aggregation calculated field to the Energy Meter 1 device profile.
  2. Add argument 1:
    • Time series key: energy
    • Argument name: energy
  3. Add argument 2:
    • Time series key: power
    • Argument name: power
  4. Add metric 1:
    • Metric name: energyHourlySum
    • Aggregation: Sum
    • Argument name: energy
  5. Add metric 2:
    • Metric name: powerHourlyAvg
    • Aggregation: Average
    • Argument name: power
  6. Add metric 3:
    • Metric name: powerHourlyMax
    • Aggregation: Max
    • Argument name: power
  7. Aggregation interval: Hour. Time zone: your reporting time zone.
  8. Output type: Time series.
  9. Click Add.

Result: At the start of each hour, the device stores:

{
"powerHourlyAvg": 12.4,
"powerHourlyMax": 18.9,
"energyHourlySum": 6.7
}

These pre-aggregated metrics reduce dashboard load and serve as reporting-ready KPIs.