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

Requests that have been moved to the Wish List, or deemed to need no further action
Post Reply
User avatar
Mark1834
Megastar
Posts: 2145
Joined: 27 Oct 2017 19:33
Family Historian: V7
Location: South Cheshire, UK

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

Post by Mark1834 » 03 Mar 2023 09:17

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.
Mark Draper

avatar
jelv
Superstar
Posts: 362
Joined: 03 Feb 2020 22:57
Family Historian: V7
Location: Mere, Wiltshire

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

Post by jelv » 03 Mar 2023 09:24

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.
John Elvin

User avatar
tatewise
Megastar
Posts: 27074
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

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

Post by tatewise » 03 Mar 2023 11:00

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.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
Mark1834
Megastar
Posts: 2145
Joined: 27 Oct 2017 19:33
Family Historian: V7
Location: South Cheshire, UK

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

Post by Mark1834 » 03 Mar 2023 11:12

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.
Mark Draper

avatar
jelv
Superstar
Posts: 362
Joined: 03 Feb 2020 22:57
Family Historian: V7
Location: Mere, Wiltshire

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

Post by jelv » 03 Mar 2023 11:23

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?
John Elvin

User avatar
ColeValleyGirl
Megastar
Posts: 4852
Joined: 28 Dec 2005 22:02
Family Historian: V7
Location: Cirencester, Gloucestershire
Contact:

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

Post by ColeValleyGirl » 03 Mar 2023 11:30

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.

avatar
jelv
Superstar
Posts: 362
Joined: 03 Feb 2020 22:57
Family Historian: V7
Location: Mere, Wiltshire

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

Post by jelv » 03 Mar 2023 12:28

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.
John Elvin

User avatar
tatewise
Megastar
Posts: 27074
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

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

Post by tatewise » 03 Mar 2023 13:37

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.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
Mark1834
Megastar
Posts: 2145
Joined: 27 Oct 2017 19:33
Family Historian: V7
Location: South Cheshire, UK

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

Post by Mark1834 » 03 Mar 2023 14:21

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.
Mark Draper

User avatar
ColeValleyGirl
Megastar
Posts: 4852
Joined: 28 Dec 2005 22:02
Family Historian: V7
Location: Cirencester, Gloucestershire
Contact:

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

Post by ColeValleyGirl » 03 Jun 2023 11:29

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.

User avatar
Mark1834
Megastar
Posts: 2145
Joined: 27 Oct 2017 19:33
Family Historian: V7
Location: South Cheshire, UK

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

Post by Mark1834 » 03 Jun 2023 11:51

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.
Mark Draper

User avatar
ColeValleyGirl
Megastar
Posts: 4852
Joined: 28 Dec 2005 22:02
Family Historian: V7
Location: Cirencester, Gloucestershire
Contact:

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

Post by ColeValleyGirl » 03 Jun 2023 12:08

Wish List Item 596 has been raised for this request.

Post Reply