Zum Hauptinhalt springen

Table.RemoveRows

Entfernt die angegebene Anzahl von Zeilen.

Syntax

Table.RemoveRows(
table as table,
offset as number,
optional count as number
) as table

Remarks

Entfernt count Zeilen vom Anfang des Elements vom Typ "table" ab dem angegebenen Wert (offset). Ohne Angabe des Parameters "count" wird als Standardanzahl der Wert 1 verwendet.

Examples

Example #1

Entfernt die erste Zeile aus der Tabelle.

Table.RemoveRows(
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"]
}),
0
)

Result:

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

Example #2

Entfernt die Zeile an der Position 1 aus der Tabelle.

Table.RemoveRows(
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
)

Result:

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

Example #3

Entfernt zwei Zeilen ab der Position 1 aus der Tabelle.

Table.RemoveRows(
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,
2
)

Result:

Table.FromRecords({
[CustomerID = 1, Name = "Bob", Phone = "123-4567"],
[CustomerID = 4, Name = "Ringo", Phone = "232-1550"]
})

Category

Table.Row operations