Table.TransformRows
使用指定的轉換函數來轉換資料表的資料列。
Syntax
Table.TransformRows(
table as table,
transform as function
) as list
Remarks
將transform作業套用至table中的每個資料列,以建立 清單。
Examples
Example #1
將資料表的列轉換成數字清單。
Table.TransformRows(
Table.FromRecords({
[a = 1],
[a = 2],
[a = 3],
[a = 4],
[a = 5]
}),
each [a]
)
Result:
{1, 2, 3, 4, 5}
Example #2
將數值資料表的列轉換成文字記錄。
Table.TransformRows(
Table.FromRecords({
[a = 1],
[a = 2],
[a = 3],
[a = 4],
[a = 5]
}),
(row) as record => [B = Number.ToText(row[a])]
)
Result:
{
[B = "1"],
[B = "2"],
[B = "3"],
[B = "4"],
[B = "5"]
}
Category
Table.Transformation