Table.DuplicateColumn
Syntaksi
Table.DuplicateColumn(table as table, columnName as text, newColumnName as text, optional columnType as nullable type) as table
Noin
Monista columnName
-niminen sarake taulukon table
. Sarakkeen arvot ja tyyppi newColumnName
kopioidaan sarakkeesta columnName
.
Esimerkki
Monista sarake "a" sarakkeeksi nimeltä "copied column" taulukossa ({[a = 1, b = 2], [a = 3, b = 4]})
.
käyttö
Table.DuplicateColumn(
Table.FromRecords({
[a = 1, b = 2],
[a = 3, b = 4]
}),
"a",
"copied column"
)
Output
Table.FromRecords({
[a = 1, b = 2, #"copied column" = 1],
[a = 3, b = 4, #"copied column" = 3]
})