Page 1 of 1

[Wish List Item 596]Implement a "nulls last" sorting option to prevent blank data appearing first when sorting

Posted: 03 Mar 2023 09:17
by Mark1834
Issue:

When tabulated data are sorted within Family Historian, missing (null) data are treated as lower than any defined value. This means that when data are sorted alphabetically (the more usual scenario), null entries appear first, and the user has to scroll down the list to find data containing the sorted field. This is inconvenient and inconsistent with how sorting operates in other familiar applications such as Microsoft Excel, where missing values are listed after sorted data.

Proposal:

A new option, set under Tools>Preferences to implement "nulls last" sorting throughout Family Historian. This would apply to all sorted data, whether in the Records Window display or tabulated data generated via a Query, Plugin, or in-built function.

Re: Implement a "nulls last" sorting option to prevent blank data appearing first when sorting

Posted: 03 Mar 2023 09:24
by jelv
Given that in records lists and queries a sort column can be defined that does this, I'm not sure this would be worth their effort.

Re: Implement a "nulls last" sorting option to prevent blank data appearing first when sorting

Posted: 03 Mar 2023 11:00
by tatewise
John, are you talking about sort Descending instead of sort Ascending and the ability to use Alt click heading to reverse the sort order?
Those are not always desirable alternatives if you want to inspect the data in alphabetical order because the items that would be near the top are then near the bottom so you still have to scroll.
Predefined Queries and Plugins don't allow the user to redefine the sort order so Alt click is the only option, which as explained above is not ideal.

Re: Implement a "nulls last" sorting option to prevent blank data appearing first when sorting

Posted: 03 Mar 2023 11:12
by Mark1834
Exactly - the proposal is to to put missing data at the end, irrespective of the sort order. It’s how both Excel and modern versions of SQL work.

Re: Implement a "nulls last" sorting option to prevent blank data appearing first when sorting

Posted: 03 Mar 2023 11:23
by jelv
For records and user queries you can always do something like I posted here: viewtopic.php?p=134468#p134468

So I think it's only predefined Queries and plugin results (which could be modified anyway) where there isn't a way round it. Given how many higher priority wish list items there are I wonder about cluttering it up with items such as this?

Re: Implement a "nulls last" sorting option to prevent blank data appearing first when sorting

Posted: 03 Mar 2023 11:30
by ColeValleyGirl
jelv wrote:
03 Mar 2023 11:23
Given how many higher priority wish list items there are I wonder about cluttering it up with items such as this?
The voting mechanism is what determines an item's priority. As Mark has said, it should be relatively easy to define this requirement so that it's ready to go onto the Wish List. What's 'cluttering up' this forum is the volume of requirements that aren't so easy to formulate, and the fact that many people who raise requirements are unwilling or unable to help get them to a well-defined state, and nobody else is enthusiastic enough about an idea to help.

Re: Implement a "nulls last" sorting option to prevent blank data appearing first when sorting

Posted: 03 Mar 2023 12:28
by jelv
Been thinking about the actual proposal some more. I can see why most of the time you'd want nulls to the end, but there are times when you'd want them to the top to highlight missing data that needs investigating. Always sorting to the end irrespective of ascending or descending would defeat that. Going in to change the setting just for the one task in hand feels wrong.

How about making the option to switch between treating null is a low value (the default, as it works now) or treating it as a high value? That way, with the high option, descending would bring them to the top.

Re: Implement a "nulls last" sorting option to prevent blank data appearing first when sorting

Posted: 03 Mar 2023 13:37
by tatewise
So perhaps the Tools > Preferences setting for listing null/empty data needs four options to be comprehensive:
  1. Lowest collation value in sort order. (as now)
  2. Highest collation value in sort order.
  3. Always first regardless of sort order.
  4. Always last regardless of sort order.

Re: Implement a "nulls last" sorting option to prevent blank data appearing first when sorting

Posted: 03 Mar 2023 14:21
by Mark1834
Didn’t think for a minute we’d avoid analysing it to death...

I can guarantee that whatever the detailed design is, it won’t cover every possible use scenario, so a “set and forgot” option is not practical. It’s got to be clear to the user, and easily described in the help text, so if we were starting from scratch, I would make it a simple nulls first/last toggle.

However, that changes the current behaviour, so is probably not preferred. IMO, four options and a techie-sounding description is too much, so how about “floating (default)/top/bottom” for the treatment of missing values, with “floating” described in more detail in the help?

The casual user who doesn’t care or read the update list won’t see any difference in how FH behaves, but the option is there for more advanced users to customise according to how they most commonly want to see it displayed.

Re: Implement a "nulls last" sorting option to prevent blank data appearing first when sorting

Posted: 03 Jun 2023 11:29
by ColeValleyGirl
Mark1834 wrote:
03 Mar 2023 14:21
Didn’t think for a minute we’d avoid analysing it to death...
Mark, you've categorised this as 'Ready for list' in Unblocking the Wish List process (21942). Is that referring to your original proposal, or are there changes needed following the subsequent discussion.

Re: Implement a "nulls last" sorting option to prevent blank data appearing first when sorting

Posted: 03 Jun 2023 11:51
by Mark1834
With the modification as discussed please, so the item becomes:

Issue:

When tabulated data are sorted within Family Historian, missing (null) data are treated as lower than any defined value. This means that when data are sorted alphabetically (the more usual scenario), null entries appear first, and the user has to scroll down the list to find data containing the sorted field. This is inconvenient and inconsistent with how sorting operates in other familiar applications such as Microsoft Excel, where missing values are listed after sorted data.

Proposal:

A new option, set under Tools>Preferences to modify the sorting of blank values throughout Family Historian. This would apply to all sorted data, whether in the Records Window display or tabulated data generated via a Query, Plugin, or in-built function. Option would be selected from “floating (default)/top/bottom", where "floating" is the current behaviour of treating missing data as lower than any defined value, "top" places all null values at the top of the sorted list, and "bottom" places all null values at the bottom of the list.

Re: Implement a "nulls last" sorting option to prevent blank data appearing first when sorting

Posted: 03 Jun 2023 12:08
by ColeValleyGirl
Wish List Item 596 has been raised for this request.