<< Click to Display Table of Contents >> Navigation: Reference > Transforms > Sort |
Sorts rows by one or more columns.
Sort by 'Last' and then First' columns:
Sort by 'Category' and then 'Score' columns. Rank for each distinct 'Category' value:
One.
•Click the button to add a new sort level.
•Click the button to move the selected sort levels up.
•Click the button to move the selected sort levels down.
•Click the button to delete the selected sort level(s).
•Click the button to clear all sort levels.
•Set Column to the column you want to sort by.
•Set Order depending on whether you want to sort this column Ascending or Descending.
•Check add rank to add a ranking column
oSet Rank type according to how you wish to do the ranking:
▪Minimum: Uses the minimum rank of each group.
▪Average: Uses the average rank of each group.
▪Maximum: Uses the maximum rank of each group.
▪Dense: Each successive rank is only incremented by 1. There are no gaps.
▪Cumulative: Shows the proportion of rows (0 to 1) with the same or lower numbered rank.
For example:
Gives the following rankings, depending on Rank type:
Rank type |
|||||
---|---|---|---|---|---|
Sorted score |
Minimum |
Average |
Maximum |
Dense |
Cumulative |
131 |
1 |
1 |
1 |
1 |
0.167 |
123 |
2 |
3 |
4 |
2 |
0.667 |
123 |
2 |
3 |
4 |
2 |
0.667 |
123 |
2 |
3 |
4 |
2 |
0.667 |
120 |
5 |
5.5 |
6 |
3 |
1 |
120 |
5 |
5.5 |
6 |
3 |
1 |
oSet Rank by to rank separately for each distinct value in this column. Leave as <None selected> if you only want a single ranking for all rows.
•If you add multiple levels, it will sort by level 1 then level 1 values that are the same will be sorted by level 2 etc.
•Number, date and text values are treated differently for sorting purposes.
•Any values that can be converted to numbers will be treated as numbers.
•Any values that match the supported date formats in Preferences will be treated as dates.
•Comparisons of text are case and whitespace sensitive. You can use Case to change the case and Whitespace to remove whitespace before sorting.
•If you want to rank rows without losing the original order, use Row Num to add a row number before the Sort, and then use another Sort on the Row Num column to return to the original order.
See also: