แชร์ผ่าน


Table.TransformRows

ไวยากรณ์

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

เกี่ยวกับ

listสร้าง โดยใช้การดําเนินการ กับtransformแต่ละแถวในtable

ตัวอย่างที่ 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"]
}