Table.ExpandRecordColumn
語法
Table.ExpandRecordColumn(table as table, column as text, fieldNames as list, optional newColumnNames as nullable list) as table
關於
指定輸入 table 中記錄的 column 之後,請建立資料表,並針對記錄中的每個欄位各包含一個資料行。 或者,也可指定 newColumnNames,以針對新資料表中的資料行確保唯一名稱。
table:要展開之記錄資料行的原始資料表。column:要展開的資料行。fieldNames:要展開至資料表中資料行的欄位清單。newColumnNames:要提供新資料行的資料行名稱清單。 新資料行名稱不能與新資料表中的任何資料行重複。
範例 1
將資料表 ({[a = [aa = 1, bb = 2, cc = 3], b = 2]}) 中的資料行 [a] 擴充成 3 個資料行 "aa"、"bb" 和 "cc"。
使用量
Table.ExpandRecordColumn(
Table.FromRecords({
[
a = [aa = 1, bb = 2, cc = 3],
b = 2
]
}),
"a",
{"aa", "bb", "cc"}
)
輸出
Table.FromRecords({[aa = 1, bb = 2, cc = 3, b = 2]})