A couple of ways come to mind:
- I’m not sure it’s possible in your case, but: instead of doing the calculations on the fly on the RG, save it to the database. Then you can use the Bubble native controls to sort it.
- The Floppy plugin’s ListShifter element has a couple of nice utilities for that.
- If you’re into some JavaScript, you might be able to use the Toolbox plugin.