Rank function
The Rank function returns the rank of each row in ascending order within the partition of a result set. The rank of a row is one plus the number of ranks that come before the row in question. All data types.
Rank().PartitionBy([QuantPerSDP].destination_location_dimension_Rkey, [QuantPerSDP].product_dimension_Rkey).OrderBy([QuantPerSDP].SumQty DESC)
The syntax of the function is:
Rank().PartitionBy(<table>.<field>).OrderBy(<table>.<field>)
Ascending order is used by default, but the DESC option can be used to specify a descending order. In the Statement Editor interface, select the Desc icon to switch to descending order. In the Statement Text Editor, add DESC to the function.
Rank can be used to rank more than one column at a time.
Rank can be used to help create a running cumulative percent of an entire table, a running percent of total (Pareto analysis) or to find the highest volume source location.
Last modified: Friday May 12, 2023