Ga naar hoofdinhoud

Table.Max

Retourneert met behulp van de opgegeven criteria de grootste rij of de standaardwaarde.

Syntax

Table.Max(
table as table,
comparisonCriteria as any,
optional default as any
) as any

Remarks

Retourneert aan de hand van de comparisonCriteria de grootste rij in de table. Als de tabel leeg is, wordt de optionele waarde default geretourneerd.

Examples

Example #1

De rij met de grootste waarde in kolom [a] in de tabel <code>({[a = 2, b = 4], [a = 6, b = 8]})</code> zoeken.

Table.Max(
Table.FromRecords({
[a = 2, b = 4],
[a = 6, b = 8]
}),
"a"
)

Result:

[a = 6, b = 8]

Example #2

De rij met de grootste waarde in kolom [a] in de tabel <code>({})</code> zoeken. Als de rij leeg is, wordt -1 geretourneerd.

Table.Max(#table({"a"}, {}), "a", -1)

Result:

-1

Category

Table.Ordering