Ανάγνωση στα Αγγλικά

Κοινή χρήση μέσω


Table.Skip

Σύνταξη

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

Περίπου

Επιστρέφει έναν πίνακα που δεν περιέχει τον πρώτο καθορισμένο αριθμό γραμμών, countOrCondition, του πίνακα table. Ο αριθμός των γραμμών που παραλείπονται εξαρτάται από την προαιρετική παράμετρο countOrCondition.

  • Εάν παραλειφθεί countOrCondition παραλείπεται μόνο η πρώτη γραμμή.
  • Εάν countOrCondition είναι αριθμός, θα παραλειφθούν τόσες πολλές γραμμές (ξεκινώντας από την κορυφή).
  • Εάν countOrCondition είναι μια συνθήκη, οι γραμμές που ικανοποιούν τη συνθήκη θα παραλειφθούν μέχρι μια γραμμή να μην ικανοποιεί τη συνθήκη.

Παράδειγμα 1

Παραλείπει την πρώτη γραμμή του πίνακα.

χρήσης

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
)

εξόδου

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

Παράδειγμα 2

Παραλείπει τις πρώτες δύο γραμμές του πίνακα.

χρήσης

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
)

εξόδου

Table.FromRecords({
    [CustomerID = 3, Name = "Paul", Phone = "543-7890"],
    [CustomerID = 4, Name = "Ringo", Phone = "232-1550"]
})

Παράδειγμα 3

Παραλείπει τις πρώτες γραμμές όπου [Price] > 25 του πίνακα.

χρήσης

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
)

εξόδου

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