Set the value of a Database Column as its position in the rows

Hi Everybody!
I’m creating a database to make an online leaderboard. Since i want that the position in shown, i made a field called “PositionLeaderboard”: how can i set its value to be automatically changed based on its position in the leaderboard?
The position is based on the value of a field called “TotalPoints”.

Or are there any other quicker options?

Thanks in advance!

Is your leaderboard a repeater? If so, you can perhaps use the INDEX value of the repeater’s cell. I think it starts at 0 so you may need to +1 it. Then you just write the index value +1 to the field in the database and you have the position it is in.