That sounds like enumeration rather than ranking.
Enumeration is when you count records to identify groups.
Ranking is grouping data based on a variables value so that the top 10 are together for example.
https://stats.idre.ucla.edu/sas/faq/how-can-i-create-an-enumeration-variable-by-groups/
... View more