Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Get the position of a record in ACS

$
0
0

Hi.

The question is simple to understand but I don't know how to do it (if it's possible) in ACS.

I have a custom object (simple table with users - score fields) and I want to show a table with 5 top scores and, at the end, display the current user score and position in the "global ranking". Like this:

pos - user- score
-----------------------
1 - user1 - 100
2 - user2 - 92
3 - user3 - 89
4 - user4 - 75
5 - user5 - 74
-----------------------
 
you are on position N with score 43
The table is easy to do, because I do the query sorted by score desc and I have it. But how to get the current user position without retrieving all the database ordered and search it on the list? Could be from 100 to 100.000 users, it's not an acceptable solution for just a single data. Any idea?

Viewing all articles
Browse latest Browse all 8068

Trending Articles