# RANK

RANK(`column`, `[ascending]`, `[rank_type]`)

Returns the rank of each element in `column`

### Arguments

| Argument      | Description                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `column`      | Column to evaluate in ranking                                                                                                                                                                                                                                                                                                                                                                                                                       |
| `[ascending]` | <p>Optional, defaults to TRUE. Order in which elements should be sorted.</p><ul><li>1: Ascending</li><li>0: Descending</li></ul>                                                                                                                                                                                                                                                                                                                    |
| `[rank_type]` | <p>Optional, defaults to "average". Option for how to rank the group of elements that have the same value.</p><ul><li>"average": average rank of the group</li><li>"min": lowest rank of the group</li><li>"max": highest rank of the group</li><li>"first": rank in order of appearance</li><li>"dense": like "min", but rank always increases by 1 between groups</li><li>"percentile": returns the percentile rank for the current row</li></ul> |

### Outputs

Outputs rank of each element in `column`.

### Example

{% embed url="<https://datawrapper.dwcdn.net/aorcs/1/>" %}
