Table.TransformRows

構文

Table.TransformRows(table as table, transform as function) as list

詳細

table の各行に transform 操作を適用し、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"]
}