* Query: count of multiple name occurances

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.
Post Reply
User avatar
ississi
Diamond
Posts: 59
Joined: 15 Feb 2021 14:47
Family Historian: V7

Query: count of multiple name occurances

Post by ississi » 01 Apr 2022 09:24

Hi, I want to do a query to show a) who's got more than one name entry, and b) how many Name entries that person has (some of them are legitimate, some are mistakes). How do I do this, please? I know the filter goes in the Rows tab, and the count in the Columns tab, but I don't know what the syntax is, and if this can be done for Names as you can't query Name in a Fact query type.
Many thanks,
Isabel
Last edited by tatewise on 01 Apr 2022 16:20, edited 1 time in total.
Reason: Changed Subject from 'fact' to 'name'

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

Re: Query: count of multiple name occurances

Post by tatewise » 01 Apr 2022 10:20

The snag is that Queries are not good at counting things. For that you need a Plugin.
Since this is a temporary investigation Query you need a quick and dirty solution.
So forget about the Rows tab and just concentrate on the Columns tab in an Individual type Query.

After the usual Individual and Record Id ( =RecordId() ) columns, add a column for each Alternate Name entry.
e.g.
Heading Expression
Name 2 %INDI.NAME[2]% Sort: Descending
Name 3 %INDI.NAME[3]%
Name 4 %INDI.NAME[4]%
et seq, for as many Alternate Names you think may exist.

Then in the Result Set you will see entries in the appropriate Columns for each name.
Last edited by tatewise on 01 Apr 2022 16:21, edited 1 time in total.
Reason: Changed Subject from 'fact' to 'name'
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
jimlad68
Megastar
Posts: 911
Joined: 18 May 2014 21:01
Family Historian: V7
Location: Sheffield, Yorkshire, UK (but from Lancashire)
Contact:

Re: Query: count of multiple name occurances

Post by jimlad68 » 01 Apr 2022 10:22

try this, gives lots of columns including up to 4 alternate names, just add extra alt name columns if you want more.

Edit - P.S. for count, show your name columns in reverse order, then sort them all "desending", that should group similar count of names together.
Last edited by tatewise on 01 Apr 2022 16:21, edited 1 time in total.
Reason: Changed Subject from 'fact' to 'name'
Jim Orrell - researching: see - but probably out of date https://gw.geneanet.org/jimlad68

User avatar
jimlad68
Megastar
Posts: 911
Joined: 18 May 2014 21:01
Family Historian: V7
Location: Sheffield, Yorkshire, UK (but from Lancashire)
Contact:

Re: Query: count of multiple name occurances

Post by jimlad68 » 01 Apr 2022 10:59

Updated attachment with more name cols and sort
Attachments
temp many names2.fhq
(2.11 KiB) Downloaded 39 times
Last edited by tatewise on 01 Apr 2022 16:22, edited 1 time in total.
Reason: Changed Subject from 'fact' to 'name'
Jim Orrell - researching: see - but probably out of date https://gw.geneanet.org/jimlad68

User avatar
davidf
Megastar
Posts: 951
Joined: 17 Jan 2009 19:14
Family Historian: V6.2
Location: UK

Re: Query: count of multiple name occurances

Post by davidf » 01 Apr 2022 15:06

Might there be a demand for a "count" type function in FH?

Count number of descendants
Count number of living descendants
Count number of great grandparents
Count number of spouses
even possibly
Count no of a fact for a person (e.g. Census entries)

=ChildCount(%INDI%) & =MediaCount(%INDI%) exist so presumably coding specific counts is possible, but is there a demand for a generalised function?
Last edited by tatewise on 01 Apr 2022 16:22, edited 1 time in total.
Reason: Changed Subject from 'fact' to 'name'
David
Running FH 6.2.7. Under Wine on Linux (Ubuntu 22.04 LTS + LXDE 11)

User avatar
ississi
Diamond
Posts: 59
Joined: 15 Feb 2021 14:47
Family Historian: V7

Re: Query: count of multiple name occurances

Post by ississi » 02 Apr 2022 10:00

Ooh love you guys! Many thanks Jim, will have a play :-)

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

Re: Query: count of multiple name occurances

Post by jelv » 11 Apr 2022 08:32

Adding
Exclude if %INDI.NAME[2]%
to the Rows tab restricts the query to just those with alternate names.

The beauty of Jim's query is that double clicking one of the alternate names opens the property box on the All tab with the alternate name selected.

Also if you see an alternate name of just a comma it means the contents of a name have been deleted leaving the empty field behind.
John Elvin

User avatar
ississi
Diamond
Posts: 59
Joined: 15 Feb 2021 14:47
Family Historian: V7

Re: Query: count of multiple name occurances

Post by ississi » 11 Apr 2022 08:50

Thanks, John :-)

User avatar
ississi
Diamond
Posts: 59
Joined: 15 Feb 2021 14:47
Family Historian: V7

Re: Query: count of multiple name occurances

Post by ississi » 11 Apr 2022 08:54

It's also possible to include columns for Given Name Used (%INDI.NAME[1]._USED%) and Nickname (%INDI.NAME[1].NICK%) if you want to see other alternative names for people.

Post Reply