Customizable sorting policy for NULL

When a user sort a table, NULLs are pushed to the top or to the bottom accordingly. However, upon many occasions, the desired result is the opposite: it would be very nice to have an option “nulls at top” / “nulls at bottom” or “reverse sort for nulls” or something like that

Hi @unguess_data

Our current sorting mechanism follows the behavior of Postgres where null values are always on top when being applied descending sort.

We’re improving the behavior so that users can customize their own sorting behavior. I will let you know when there is an update.

For now, as a workaround, you need to create business calculation to turn all Null value into 0

The formula could be something like:

case( 
  when: is(count(model.field), null) 
  , then: 0 
  , else: count(model.field) 
)

Hope this helps.

Thank you for your suggestion, although it doesn’t suit my use case, or just few.
In fact, adapting your logic to my needs, sometimes I would need to set NULL as +∞ OR - ∞ just to guarantee the desired sort behaviour but this would be wrong and also very inconvenient . Further, upon most of occasion when I have NULLs, they are such with the purpose to be distinguished from zeros…!
The only solution to me would be being able to customize how NULLs are managed contextually to applying the sorting: I’m glad to hear that you are working on it! Thank you!