docs-v2/content/flux/v0.x/stdlib/universe/lowestmin.md

2.1 KiB

title description aliases menu weight flux/v0.x/tags introduced
lowestMin() function The `lowestMin()` function selects the minimum record from each table in the input stream and returns the lowest `n` records.
/influxdb/v2.0/reference/flux/functions/transformations/selectors/lowestmin
/influxdb/v2.0/reference/flux/functions/built-in/transformations/selectors/lowestmin/
/influxdb/v2.0/reference/flux/stdlib/built-in/transformations/selectors/lowestmin/
/influxdb/cloud/reference/flux/stdlib/built-in/transformations/selectors/lowestmin/
flux_0_x_ref
name parent
lowestMin universe
102
selectors
transformations
0.7.0

The lowestMin() function selects the minimum record from each table in the input stream and returns the lowest n records. The function outputs a single aggregated table containing n records. lowestMin() is a selector function.

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

{{% warn %}}

Empty tables

lowestMin() drops empty tables. {{% /warn %}}

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

{{% flux/sample-example-intro %}}

import "sampledata"

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

{{< expand-wrapper >}} {{% expand "View input and output" %}} {{< flex >}} {{% flex-content %}}

Input data

{{% flux/sample "int" %}}

{{% /flex-content %}} {{% flex-content %}}

Output data
_time tag _value
2021-01-01T00:00:20Z t2 -3
2021-01-01T00:00:00Z t1 -2

{{% /flex-content %}} {{< /flex >}} {{% /expand %}} {{< /expand-wrapper >}}