It would be convenient, if a query could have the order number (in the selected sort order) displayed as a printout. For instance, if I wanted to display a table about the the world TOP50 countries according to population, it would be nice to have the order of each country (1-50) displayed in the first column. In a template, the order number could be used with a parserfunctions to change color or symbol according to rank.
Maybe the #ask query could have a printout statement "|#" (or whatever) for the order number similar as "|?" is for the mainlabels?
So a query similar to this:
{{#ask:
[[Category:Country]]
|#=Rank
|?=Country
|?Population
|sort=Population
|order=desc
|limit=3
}}
Would output a table like this:
Rank Country Population
1 China 1,439,323,776
2 India 1,380,004,385
3 USA 331,002,651
The order number should always be in relation to the query sort, so if an offset is specified, the order number of the first item would be offset+1.
Have a look at this documentation The offset is however not considered. I believe it this case you would have to annotate the ranking.
Thanks! I had missed that while browsing through the documentation. I actually don't need the offset, so this is just perfect for me.