Nuta
Dostęp do tej strony wymaga autoryzacji. Możesz spróbować się zalogować lub zmienić katalog.
Dostęp do tej strony wymaga autoryzacji. Możesz spróbować zmienić katalogi.
Składnia
Table.AddRankColumn(
table as table,
newColumnName as text,
comparisonCriteria as any,
optional options as nullable record
) as table
Informacje
Dołącza kolumnę o nazwie newColumnName do table z rankingiem jednej lub więcej innych kolumn opisanych przez comparisonCriteria. Opcja RankKind w options programie może być używana przez zaawansowanych użytkowników do wybierania bardziej specyficznej metody klasyfikacji.
Przykład 1
Dodaj kolumnę o nazwie RevenueRank do tabeli, która plasuje kolumnę Revenue (Przychód ) z najwyższej do najniższej.
Użycie
Table.AddRankColumn(
Table.FromRecords({
[CustomerID = 1, Name = "Bob", Revenue = 200],
[CustomerID = 2, Name = "Jim", Revenue = 100],
[CustomerID = 3, Name = "Paul", Revenue = 200],
[CustomerID = 4, Name = "Ringo", Revenue = 50]
}),
"RevenueRank",
{"Revenue", Order.Descending},
[RankKind = RankKind.Competition]
)
Wyjście
Table.FromRecords({
[CustomerID = 1, Name = "Bob", Revenue = 200, RevenueRank = 1],
[CustomerID = 3, Name = "Paul", Revenue = 200, RevenueRank = 1],
[CustomerID = 2, Name = "Jim", Revenue = 100, RevenueRank = 3],
[CustomerID = 4, Name = "Ringo", Revenue = 50, RevenueRank = 4]
})