Syntax
Table.DuplicateColumn(
table as table,
columnName as text,
newColumnName as text,
optional columnType as nullable type
) as table
About
复制名为 columnName 表 table的列。 列的值和类型 newColumnName 是从列 columnName复制的。
Example
将列“a”复制到表中 ({[a = 1, b = 2], [a = 3, b = 4]})名为“复制列”的列。
用法
Table.DuplicateColumn(
Table.FromRecords({
[a = 1, b = 2],
[a = 3, b = 4]
}),
"a",
"copied column"
)
输出
Table.FromRecords({
[a = 1, b = 2, #"copied column" = 1],
[a = 3, b = 4, #"copied column" = 3]
})