文档文档

highestCurrent() function

highestCurrent() selects the last record from each input table and returns the highest n records.

Note: highestCurrent() drops empty tables.

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

For more information, see Function type signatures.

Parameters

n

(Required) Number of records to return.

column

Column to evaluate. Default is _value.

groupColumns

List of columns to group by. Default is [].

tables

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

Examples

Return the highest current value from a stream of tables

import "sampledata"

sampledata.int()
    |> highestCurrent(n: 1, groupColumns: ["tag"])

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 的基础上,增加了历史查询能力、读取副本、高可用性、可扩展性和细粒度的安全性。

有关如何入门的更多信息,请查看