Table.Skip

Syntax

Table.Skip(table as table, optional countOrCondition as any) as table

About

Returns a table that does not contain the first specified number of rows, countOrCondition, of the table table. The number of rows skipped depends on the optional parameter countOrCondition.

  • If countOrCondition is omitted only the first row is skipped.
  • If countOrCondition is a number, that many rows (starting at the top) will be skipped.
  • If countOrCondition is a condition, the rows that meet the condition will be skipped until a row does not meet the condition.

Example 1

Skip the first row of the table.

Table.Skip(Table.FromRecords({ [CustomerID = 1, Name = "Bob", Phone = "123-4567"], [CustomerID = 2, Name = "Jim", Phone = "987-6543"] , [CustomerID = 3, Name = "Paul", Phone = "543-7890"] , [CustomerID = 4, Name = "Ringo", Phone = "232-1550"]}), 1)
CustomerID Name Phone
2 Jim 987-6543
3 Paul 543-7890
4 Ringo 232-1550

Example 2

Skip the first two rows of the table.

Table.Skip(Table.FromRecords({[CustomerID = 1, Name = "Bob", Phone = "123-4567"],[CustomerID = 2, Name = "Jim", Phone = "987-6543"], [CustomerID = 3, Name = "Paul", Phone = "543-7890"], [CustomerID = 4, Name = "Ringo", Phone = "232-1550"]}), 2)
CustomerID Name Phone
3 Paul 543-7890
4 Ringo 232-1550

Example 3

Skip the first rows where [Price] > 25 of the table.

Table.Skip(Table.FromRecords({[OrderID = 1, CustomerID = 1, Item = "Fishing rod", Price = 100.0], [OrderID = 2, CustomerID = 1, Item = "1 lb. worms", Price = 5.0], [OrderID = 3, CustomerID = 2, Item = "Fishing net", Price = 25.0], [OrderID = 4, CustomerID = 3, Item = "Fish tazer", Price = 200.0], [OrderID = 5, CustomerID = 3, Item = "Bandaids", Price = 2.0], [OrderID = 6, CustomerID = 1, Item = "Tackle box", Price = 20.0], [OrderID = 7, CustomerID = 5, Item = "Bait", Price = 3.25], [OrderID = 8, CustomerID = 5, Item = "Fishing Rod", Price = 100.0], [OrderID = 9, CustomerID = 6, Item = "Bait", Price = 3.25]}), each [Price] > 25)
OrderID CustomerID Item Price
2 1 1 lb. worms 5
3 2 Fishing net 25
4 3 Fish tazer 200
5 3 Bandaids 2
6 1 Tackle box 20
7 5 Bait 3.25
8 5 Fishing Rod 100
9 6 Bait 3.25