Table.SplitAt

Table.SplitAt(table as table, count as number) as list

About

返回一个包含两个表的列表:一个表,其中前 N 行 table (按 count指定)和一个包含其余行的 table表。 如果结果列表的表按一次顺序枚举,该函数将仅枚举 table 一次。

示例 1

返回表的前两行和表的其余行。

用法

Table.SplitAt(#table({"a", "b", "c"}, {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}), 2)

输出

{
    #table({"a", "b", "c"}, {{1, 2, 3}, {4, 5, 6}}),
    #table({"a", "b", "c"}, {{7, 8, 9}})
}