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