Table.TransformRows
语法
Table.TransformRows(table as table, transform as function) as list
关于
通过将 transform
操作应用于 table
中的每一行来创建 list
。
示例 1
将表的行转换为数字列表。
使用情况
Table.TransformRows(
Table.FromRecords({
[a = 1],
[a = 2],
[a = 3],
[a = 4],
[a = 5]
}),
each [a]
)
输出
{1, 2, 3, 4, 5}
示例 2
将数值表的行转换为文本记录。
使用情况
Table.TransformRows(
Table.FromRecords({
[a = 1],
[a = 2],
[a = 3],
[a = 4],
[a = 5]
}),
(row) as record => [B = Number.ToText(row[a])]
)
输出
{
[B = "1"],
[B = "2"],
[B = "3"],
[B = "4"],
[B = "5"]
}