Documentation

getColumn() function

Flux 0.29.0+

The getColumn() function extracts a column from a table given its label. If the label is not present in the set of columns, the function errors.

getColumn(column: "_value")

Use tableFind() to extract a single table

getColumn() requires a single table as input. Use tableFind() to extract a single table from a stream of tables.

Parameters

column

Name of the column to extract.

table

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

Example

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

import "sampledata"

sampledata.int()
  |> tableFind(fn: (key) => key.tag == "t1")
  |> getColumn(column: "_value")

// Returns [-2, 10, 7, 17, 15, 4]

Upgrade to InfluxDB Cloud or InfluxDB 2.0!

InfluxDB Cloud and InfluxDB OSS 2.0 ready for production.