แชร์ผ่าน


Table.DuplicateColumn

วากยสัมพันธ์

Table.DuplicateColumn(
    table as table,
    columnName as text,
    newColumnName as text,
    optional columnType as nullable type
) as table

ประมาณ

ทําซ้ําคอลัมน์ที่ชื่อว่า columnName ไปยังตาราง table ค่าและชนิดสําหรับ newColumnName คอลัมน์จะถูกคัดลอกจากคอลัมน์ columnName

ตัวอย่าง

ทําซ้ําคอลัมน์ "a" ไปยังคอลัมน์ที่ชื่อ "copied column" ในตาราง ({[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]
})
  • ชนิดและการแปลงชนิด