* How to sort results by surname when using Work with Data option?

Questions regarding use of any Version of Family Historian. Please ensure you have set your Version of Family Historian in your Profile. If your question fits in one of these subject-specific sub-forums, please ask it there.
User avatar
Mark1834
Megastar
Posts: 2146
Joined: 27 Oct 2017 19:33
Family Historian: V7
Location: South Cheshire, UK

Re: How to sort results by surname when using Work with Data option?

Post by Mark1834 » 21 Nov 2022 11:36

tatewise wrote:
21 Nov 2022 11:12
What is currently displayed depends on the Display individuals surname first option so that users can choose how the records themselves are displayed and sorted by given name or surname when clicking the column header.
OK, my mistake - that's what happens when you rush to post to get the dog out for its morning walk before the rain sets in :) .

Not sure I understand what you mean here though - doesn't that setting just affect how the Records Window displays? It still sorts by surname when you click on the column heading, even if displayed given name first. So isn't the nub of the problem that the Records Window sorts by surname, irrespective of how it displays, and the Tools > Work with Data output can only display and sort by given name first. That's the key inconsistency isn't it?
Mark Draper

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

Re: How to sort results by surname when using Work with Data option?

Post by tatewise » 21 Nov 2022 12:07

We both seem to be guilty of misunderstanding exactly how FH behaves, but agree that FH is inconsistent.

Yes, the Display individuals surname first option only affects (some) displays and not the sort order :oops:
The displays affected are the Records Window, Named Lists, Record Select dialogues, etc, but NOT any Result Sets.
They all sort by Surname first regardless of the display option, including Query Result Sets, but NOT Plugin Result Sets or Tools > Work with Data > Where Used Result Sets that sort by given name.

So perhaps the Wish List should be for consistent application of the display and sorting to all Result Sets?
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

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

Re: How to sort results by surname when using Work with Data option?

Post by Mark1834 » 21 Nov 2022 12:26

Sounds good - I think we were both getting confused by the other person's mistakes, but we've ended up at a point that takes the best elements of both options. All such listings to mirror how the Records Window behaves, with consistent surname-first sorting and a display that reflects the Options setting.
Mark Draper

avatar
Little.auk
Famous
Posts: 224
Joined: 23 Jul 2021 08:51
Family Historian: V7
Location: Tamworth, Staffordshire, UK

Re: How to sort results by surname when using Work with Data option?

Post by Little.auk » 21 Nov 2022 19:52

Little.auk wrote:
20 Nov 2022 11:39
You can use the following Excel equation to extract a surname at the end of a string,
=RIGHT(C3,LEN(C3)-FIND(CHAR(134),SUBSTITUTE(C3,"#",CHAR(134),(LEN(C3)-LEN(SUBSTITUTE(C3,"#","")))/LEN("#"))))
In an earlier post I gave the above equation for stripping the Surname in Excel - but there is a simpler way that handles all variants of names including double barrelled surnames like Du Sautoy.

It is much easier to split names into First Names and Surnames with an FH query, than it is to do it in Excel, so ----

First create an FH "ALL NAMES" query with three columns NAME (%INDI.NAME%), FIRST NAME (%INDI.NAME:GIVEN_ALL%) and SURNAME (%INDI.NAME:SURNAME%) and save the results set as a CSV file.

Open this file in Excel and save it as an Excel workbook to create a names data set.

You can then use the Excel LOOKUP() function to find the name in the names data set and retrieve the already stripped Surname and/or First Name.
Peter Rollin
Running FH 7.0.20 and AS 7.7.7 64 bit in Windows 11

Post Reply