Table.RemoveFirstN
Tiek atgriezta tabula ar pirmajām izlaistajām skaita rindām.
Syntax
Table.RemoveFirstN(
table as table,
optional countOrCondition as any
) as table
Remarks
Atgriež tabulu, kurā nav ietverts tabulas table pirmais norādītais rindu skaits countOrCondition. Noņemto rindu skaits ir atkarīgs no neobligātā parametra countOrCondition.
- Ja
countOrConditionnav norādīts, tiek noņemta tikai pirmā rinda. - Ja
countOrConditionir skaitlis, tiek noņemts attiecīgais rindu skaits (sākot no augšas). - Ja
countOrConditionir nosacījums, tiek noņemtas nosacījumam atbilstošās rindas, līdz rinda neatbilst nosacījumam.
Examples
Example #1
Noņemiet tabulas pirmo rindu.
Table.RemoveFirstN(
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 = 2, Name = "Jim", Phone = "987-6543"],
[CustomerID = 3, Name = "Paul", Phone = "543-7890"],
[CustomerID = 4, Name = "Ringo", Phone = "232-1550"]
})
Example #2
Noņemiet tabulas pirmās divas rindas.
Table.RemoveFirstN(
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
)
Result:
Table.FromRecords({
[CustomerID = 3, Name = "Paul", Phone = "543-7890"],
[CustomerID = 4, Name = "Ringo", Phone = "232-1550"]
})
Example #3
Noņemiet tabulas pirmās rindas, kur [CustomerID] <=2.
Table.RemoveFirstN(
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"]
}),
each [CustomerID] <= 2
)
Result:
Table.FromRecords({
[CustomerID = 3, Name = "Paul", Phone = "543-7890"],
[CustomerID = 4, Name = "Ringo", Phone = "232-1550"]
})
Category
Table.Row operations