I have this formula where I get data from an API. I want to sort the data by total_races, but for tiebreakers it should be determined by races wins, podiums and least DNFs. How should I edit my formula to obtain this?
✅1
Andreas Møller
2 years ago
If you give the sort formula an array as second input it will sort based on priority
Lukas Mohr
2 years ago
Inbetween the API and the Sort by?
Andreas Møller
2 years ago
No instead of Item/total_races you give it an array where Item/total races is the first item.
Then what ever you want to sort by after that as item 2
Andreas Møller
2 years ago
Does that make sense?
Lukas Mohr
2 years ago
{{ total_races, races_won, top_three_finishes }} like this?
Lukas Mohr
2 years ago
Maybe I got it
Lukas Mohr
2 years ago
But not working as inteded.
Andreas Møller
2 years ago
Almost, pick total races on the bottom left node
Then that will be the primary sort criterion
If you add more items to the array it will sort by them in case of a tie
✅1
Lukas Mohr
2 years ago
Very easy then! Many thanks 😄
noCode.Lad
2 years ago
I learnt something here today. Many thanks
Xioteer
1 year ago
Let me revive this one. The above is clear. How can I reverse the sorting of the second one? I have first criteria "dates", ascending The second one is something else, sorting works, but I would like to have that descending. Is that possible?
Xioteer
1 year ago
Got a second thing here With the standard sorting positive and negative numbers are handled separately. It's sorted by P/L on the right. There you can see what is happening. It's restarting with the highest negative number instead of decreasing from 0.00
every api is different. I obviously declare my Xano ones as numbers if I can. But this one is just sending everything as strings. Gotta keep an eye on that