getColumn() function
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]
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for Flux and this documentation. To find support, the following resources are available:
InfluxDB Cloud customers can contact InfluxData Support.