แชร์ผ่าน


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]
})