count() function

The count() function outputs the number of records in each aggregated column. It counts both null and non-null records.

Function type: Aggregate
Output data type: Integer

count(column: "_value")

Count empty tables

count() returns 0 for empty tables. To keep empty tables in your data, set the following parameters for the following functions:

Function Parameter
filter() onEmpty: "keep"
window() createEmpty: true
aggregateWindow() createEmpty: true

Parameters

column

Column on which to operate. Defaults to "_value".

Data type: String

Examples

from(bucket: "telegraf/autogen")
  |> range(start: -5m)
  |> count()
from(bucket: "telegraf/autogen")
  |> range(start: -5m)
  |> count(column: "_value")

COUNT()

This documentation is open source. See a typo? Please, open an issue.


Need help getting up and running? Get Support