跳至主要内容

Table.SplitAt

傳回清單,內含指定的前幾個計數資料列及其餘的資料列。

Syntax

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

Remarks

傳回包含兩個資料表的清單: 一個資料表具有 table 的前 N 列 (由 count 所指定),另一個資料表包含 table 的其餘資料列。 如果產生之清單的資料表剛好按順序列舉一次,則函式只會列舉 table 一次。

Examples

Example #1

傳回資料表的前兩列,以及資料表的其餘資料列。

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

Result:

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

Category

Table.Row operations