Table.TransformColumnTypes

ไวยากรณ์

Table.TransformColumnTypes(table as table, typeTransformations as list, optional culture as nullable text) as table

เกี่ยวกับ

แสดงตารางจากข้อมูลป้อนเข้า table โดยนําการดําเนินการแปลงข้อมูลไปใช้กับคอลัมน์ที่ระบุในพารามิเตอร์ typeTransformations (ซึ่งรูปแบบคือ { column name, type name}) โดยใช้วัฒนธรรมที่ระบุในพารามิเตอร์ culture ที่เลือกได้ (ตัวอย่างเช่น "en-US") ถ้าไม่มีคอลัมน์อยู่ ระบบจะแสดงข้อยกเว้น

ตัวอย่างที่ 1

แปลงค่าตัวเลขในคอลัมน์ [a] เป็นค่าข้อความจากตาราง({[a = 1, b = 2], [a = 3, b = 4]})

การใช้งาน

Table.TransformColumnTypes(
    Table.FromRecords({
        [a = 1, b = 2],
        [a = 3, b = 4]
    }),
    {"a", type text},
    "en-US"
)

เอาท์พุท

Table.FromRecords({
    [a = "1", b = 2],
    [a = "3", b = 4]
})