Rank
Rank Function
Assigns rank for a group of rows based on the given group by and order by conditions.
Syntax
Rank(table Table, array GroupByColumns, scalar Rank, scalar Column, scalar Order, scalar Column, scalar Order, ...)
Arguments
| Argument | Description |
|---|---|
table Table | Table |
array GroupByColumns | Array of column vectors to group the data |
scalar Rank | Rank if 0, all rows will be returned |
scalar Column | Column name to get rank over |
scalar Order | Order of the column to get rank over ♣ true for ascending ♣ false for descending |
Examples:
Rank([[FusionTestTable]], array([FusionTestTable.VarcharColumn], [FusionTestTable.SmallIntColumn]),1, [FusionTestTable.DateTimeCol], true, [FusionTestTable.IntColumn], false, [FusionTestTable.DoubleColumn], false )
Returns rows of data grouped by "VarcharColumn" and "SmallIntColumn" with the specified rank ordered by "DateTimeCol" ascending, "IntColumn" and "DoubleColumn" descending.