Sort database queries on aggregated fields

Voted…

Is there any custom workaround to make sorting on aggregated fields working in the meantime?
I need to make a leaderboard that’s sorted by total sales count, being able to sort on aggregated value, points, amounts etc is crucial for my app…

Edit:

Made it work by changing the api file manually as suggested in this post:

It’s sorting now with the aggregated field.
Would be great if this could be in the Wappler UI though as I believe I will have to update this manually each time I play around in that api in the UI