Documentation

duplicate() function

Flux 0.7.0+

The duplicate() function duplicates a specified column in a table. If the specified column is part of the group key, it will be duplicated, but will not be part of the output table’s group key.

duplicate(column: "column-name", as: "duplicate-name")

Parameters

column

(Required) Column to duplicate.

as

(Required) Name assigned to the duplicate column.

If the as column already exists, this function will overwrite the existing values.

tables

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

Examples

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

import "sampledata"

sampledata.int()
	|> duplicate(column: "tag", as: "tag_dup")

View input and output


Upgrade to InfluxDB Cloud or InfluxDB 2.0!

InfluxDB Cloud and InfluxDB OSS 2.0 ready for production.