duplicate() function

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")



(Required) Column to duplicate.


(Required) Name assigned to the duplicate column.

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


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


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

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

View input and output

Was this page helpful?

Thank you for your feedback!

Upgrade to InfluxDB Cloud or InfluxDB 2.0!

InfluxDB Cloud and InfluxDB OSS 2.0 ready for production.