Search code examples
influxdb

InfluxDB: query aggregations but deal with missing data


In InfluxDB I want to query our dataset for aggregations. Usually our sensor send data every 30 minutes. We can get values like mean per hour etc. IN some occasions, we might mis a few hours of data. We want influx to keep taking the last value for these 'missing' steps to calculate the aggregation.

Is this possible ?


Solution

  • Use the fill option in your time grouping. I would say previous is the option, which you want:

    previous Reports the value from the previous time interval for time intervals with no data.

    https://docs.influxdata.com/influxdb/v1.7/query_language/data_exploration/#group-by-time-intervals-and-fill