Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Guys,
The same ranks in the first column, I need to rank according to the reference_rank.
Are you sure you need rank for the second condition? Isn't it Enough sort?
The first column has the same rank, like 4, 7,12. I need to distiguish the rank by the third field, like Rank_1
Rank | Totoal_Pts | Reference_Rank | Rank_1 |
1 | 19 | 2 | 1 |
2 | 18 | 3 | 2 |
3 | 17 | 1 | 3 |
4 | 14 | 4 | 4 |
4 | 14 | 8 | 6 |
4 | 14 | 7 | 5 |
7 | 13 | 5 | 7 |
7 | 13 | 6 | 8 |
9 | 12 | 9 | 9 |
10 | 11 | 10 | 10 |
11 | 8 | 12 | 11 |
12 | 6 | 11 | 12 |
12 | 6 | 13 | 13 |
12 | 6 | 14 | 14 |
what about concatenate the two fields into one and then ranking this new one?
only the duplicated rank need to rank again..
rank(total (
-rank(Totoal_Pts,1,1)*NoOfRows()+rank(Reference_Rank,1,1)
))
It's can also adapt to any number of conditions.