Rank
Ranking function returns a numerical rank for metric values in ascending, default, order (the smallest value ranked first) or descending order (the largest value ranked first).
A key feature of the ranking functions is WITHIN Clause that allows you to carry out rankings of multiple attribute subgroups within a single report.
Syntax
The following syntax applies to all supported Rank Variations.
SELECT RANK(…) [ASC | DESC] [WITHIN(…)]*
SELECT RANK(metric)
SELECT RANK(metric) WITHIN(CURRENT)
SELECT RANK(metric) WITHIN(attribute1, attribute2, [...])
SELECT RANK(metric) WITHIN(attribute ALL OTHER | ALL OTHER EXCEPT FOR...)
Examples
The following examples apply to all supported Rank Variations.
SELECT RANK(Avg. Won)
SELECT RANK(Amount_Won) ASC WITHIN(Year(Closed))
SELECT RANK(Amount_Won) WITHIN(CURRENT)
SELECT RANK(Amount_Won) WITHIN(ALL OTHER)
Select from the following topics to get more information:
- Create a Rank over Time Report
- Rank Variations
- WITHIN Clause
- WHERE TOP or BOTTOM(n) IN
- WHERE TOP or BOTTOM(n) OF
- Using Ranking Filters
- PERCENTILE
Thank you for your feedback!
Thank you for your feedback!
If you can't find what you need, don't hesitate to send us a comment.
Any questions?
Check out the GoodData community.