Documentation

bottom() function

The bottom() function sorts a table by columns and keeps only the bottom n records. bottom() is a selector function.

bottom(n:10, columns: ["_value"])

Empty tables

bottom() drops empty tables.

Parameters

n

Number of records to return.

columns

List of columns by which to sort. Sort precedence is determined by list order (left to right). Default is ["_value"].

tables

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

Examples

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

Return rows with the two lowest values

import "sampledata"

sampledata.int()
    |> bottom(n:2)

View input and output


Was this page helpful?

Thank you for your feedback!


Upgrade to InfluxDB Cloud or InfluxDB 2.0!

InfluxDB Cloud and InfluxDB OSS 2.0 ready for production.