Table.ExpandListColumn
Syntax
Table.ExpandListColumn(table as table, column as text) as table
About
Given a table
where column
contains a list of values, splits the list into a row for each value. Values in the other columns are duplicated in each new row created. This function can also expand nested tables by treating them as lists of records.
Example 1
Split the list column [Name].
Usage
Table.ExpandListColumn(
Table.FromRecords({[Name = {"Bob", "Jim", "Paul"}, Discount = .15]}),
"Name"
)
Output
Table.FromRecords({
[Name = "Bob", Discount = 0.15],
[Name = "Jim", Discount = 0.15],
[Name = "Paul", Discount = 0.15]
})
Example 2
Split the nested table column [Components].
Usage
Table.ExpandListColumn(
#table(
{"Part", "Components"},
{
{"Tool", #table({"Name", "Quantity"}, {{"Thingamajig", 2}, {"Widget", 3}})}
}
),
"Components"
)
Output
Table.FromRecords({
[Part = "Tool", Components = [Name = "Thingamajig", Quantity = 2]],
[Part = "Tool", Components = [Name = "Widget", Quantity = 3]]
})
Phản hồi
https://aka.ms/ContentUserFeedback.
Sắp ra mắt: Trong năm 2024, chúng tôi sẽ dần gỡ bỏ Sự cố với GitHub dưới dạng cơ chế phản hồi cho nội dung và thay thế bằng hệ thống phản hồi mới. Để biết thêm thông tin, hãy xem:Gửi và xem ý kiến phản hồi dành cho