Bagikan melalui


Table.TransformRows

Sintaksis

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

Tentang

Membuat list dengan menerapkan operasi transform ke setiap baris di table.

Contoh 1

Mengubah baris tabel menjadi daftar angka.

Penggunaan

Table.TransformRows(
    Table.FromRecords({
        [a = 1],
        [a = 2],
        [a = 3],
        [a = 4],
        [a = 5]
    }),
    each [a]
)

Output

{1, 2, 3, 4, 5}

Contoh 2

Mengubah baris tabel numerik menjadi rekaman tekstual.

Penggunaan

Table.TransformRows(
    Table.FromRecords({
        [a = 1],
        [a = 2],
        [a = 3],
        [a = 4],
        [a = 5]
    }),
    (row) as record => [B = Number.ToText(row[a])]
)

Keluaran

{
    [B = "1"],
    [B = "2"],
    [B = "3"],
    [B = "4"],
    [B = "5"]
}