Issues when Sorting by desc float fields

Hello team, Currently I have a float field to store distance cycled values, on my fronted I would like to sort the records by Highest & Lowest distance. However, I noticed that if the field is not filled yet the sorting prioritizes the null values instead of the filled one when trying to sort DESC. check the following screenshot:

distanceCycled2_ASC (Works as expected):

distanceCycled2_DESC (Iā€™m expecting the Highest values first and the null values always at the end)

Let me know your thoughts, please.

UPDATE: I solve the issue by setting the default value as 0

1 Like

Hello @gerald

Glad to know you solved it! Do you think the sorting behaviour was unintuitive with how it interacted with null values? If so, what behaviour did you expected on your end?
Thank you for the feedback!

Hello @m.finamor, The default behavior that I was expecting when sorting in descending order (xx__DESC) is to have the highest values appear first, with null values consistently placed at the end. This is especially relevant for fields that are not required, and where providing a default value is not desirable. Let me know your thoughts :).

2 Likes