Rank
Create a ranking of values in a column.
Parameters
Name | Type | Description | Is Optional |
---|---|---|---|
rank_columns | column_list | The column or expression to order (rank) by | |
partition_by | column_list | The column or expression to partition the window by. Accepts . | True |
order | sort_direction | Instruction on how to order the rank_column. Accepts , but defaults to ASC. ASC = Ascending DESC = Descending | True |
rank_type | value | Type of ranking [ | dense | percent | unique ]. Accepts . = ANSI SQL rank function dense = ANSI SQL dense_rank function percent = ANSI SQL percent_rank function unique = ANSI SQL row_number function | True |
qualify_filter | value | A filter to apply to the ranked column. Accepts . | True |
alias | string | Name of the output column containing rankings | True |
overwrite_columns | boolean | Optional: if true, the columns passed in 'rank_columns' will be dropped from the output | True |
Example
Source Code
Last updated