Table.ExpandTableColumn

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

Table.ExpandTableColumn(
    table as table,
    column as text,
    columnNames as list,
    optional newColumnNames as nullable list
) as table

ประมาณ

ขยายตารางใน table[column] เป็นหลายแถวและคอลัมน์ columnNames ถูกใช้เพื่อเลือกคอลัมน์ที่จะขยายจากตารางภายใน ระบุ newColumnNames เพื่อหลีกเลี่ยงความขัดแย้งระหว่างคอลัมน์ที่มีอยู่และคอลัมน์ใหม่

โปรดทราบว่า นอกเหนือจากตารางที่ซ้อนกัน ฟังก์ชันยังสนับสนุนการขยายรายการที่ซ้อนกันของเรกคอร์ด

ตัวอย่าง

ขยายคอลัมน์ ตําแหน่งที่ตั้ง ลงในสองคอลัมน์ใหม่

การใช้งาน

Table.ExpandTableColumn(
    Table.FromRecords({
        [
            Company = "Contoso",
            Locations = Table.FromRecords({
                [City = "Redmond", State = "WA"],
                [City = "Bellevue", State = "WA"],
                [City = "Tempe", State = "AZ"]
            })
        ]
    }),
    "Locations",
    {"City", "State"},
    {"Locations.City", "Locations.State"}
)

ผลลัพธ์ของ

Table.FromRecords({
    [Company = "Contoso", Locations.City = "Redmond", Locations.State = "WA"],
    [Company = "Contoso", Locations.City = "Bellevue", Locations.State = "WA"],
    [Company = "Contoso", Locations.City = "Tempe", Locations.State = "AZ"]
})