文档文档

bottom() function

bottom() sorts each input table by specified columns and keeps the bottom n records in each table.

Note: bottom() drops empty tables.

Function type signature
(<-tables: stream[A], n: int, ?columns: [string]) => stream[A] where A: Record

For more information, see Function type signatures.

Parameters

n

(Required) Number of rows to return from each input table.

columns

List of columns to sort by. Default is ["_value"].

Sort precedence is determined by list order (left to right).

tables

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

Examples

Return rows with the two lowest values in each input table

import "sampledata"

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

View example input and output


Was this page helpful?

Thank you for your feedback!


Flux 的未来

Flux 即将进入维护模式。您可以继续像现在一样使用它,而无需对代码进行任何更改。

阅读更多

InfluxDB 3 开源版现在处于公开 Alpha 测试阶段

InfluxDB 3 开源版现在可用于 Alpha 测试,并根据 MIT 或 Apache 2 许可获得许可。

我们正在发布两个产品作为 Alpha 测试的一部分。

InfluxDB 3 Core,是我们的新开源产品。它是时间序列和事件数据的最新数据引擎。InfluxDB 3 Enterprise 是一个商业版本,它建立在 Core 的基础上,增加了历史查询功能、读取副本、高可用性、可扩展性和细粒度的安全性。

有关如何开始使用的更多信息,请查看