Documentation

lowestAverage() function

Flux 0.7.0+

The lowestAverage() function calculates the average of each table in the input stream returns the lowest n records. The function outputs a single aggregated table containing n records. lowestAverage() is a selector function.

lowestAverage(
  n:10,
  column: "_value",
  groupColumns: []
)

Empty tables

lowestAverage() drops empty tables.

Parameters

n

Number of records to return.

column

Column by which to sort. Default is "_value".

groupColumns

The columns on which to group before performing the aggregation. Default is [].

tables

Input data. Default is piped-forward data (<-).

Examples

The following example uses data provided by the sampledata package to show how lowestAverage() transforms data.

import "sampledata"

sampledata.int()
  |> lowestAverage(n: 2, groupColumns: ["tag"])

View input and output


Upgrade to InfluxDB Cloud or InfluxDB 2.0!

InfluxDB Cloud and InfluxDB OSS 2.0 ready for production.