Table.ExpandRecordColumn

语法

Table.ExpandRecordColumn(table as table, column as text, fieldNames as list, optional newColumnNames as nullable list) as table

关于

给定输入 table 中的记录 column,创建一个表,其中包含对应记录中每个字段的列。 还可以指定 newColumnNames 以确保新表中的列具有唯一名称。

  • table:含要展开的记录列的原始表。
  • column:要展开的列。
  • fieldNames:要展开为表中列的字段的列表。
  • newColumnNames:要提供给新列的列名的列表。 新列名不能与新表中的任何列重复。

示例 1

将表 ({ [a = [aa = 1, bb = 2, cc = 3], b = 2] }) 中的列 [a] 扩展为“aa”、“bb”和“cc”3 列。

使用情况

Table.ExpandRecordColumn(    Table.FromRecords({         [            a = [aa = 1, bb = 2, cc = 3],            b = 2        ]     }),    "a",    { "aa", "bb", "cc" })

输出

Table.FromRecords({ [aa = 1, bb = 2, cc = 3, b = 2] })

results matching ""

    No results matching ""