Page 1 of 1
Query: count of multiple name occurances
Posted: 01 Apr 2022 09:24
by ississi
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
Re: Query: count of multiple name occurances
Posted: 01 Apr 2022 10:20
by tatewise
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.
Re: Query: count of multiple name occurances
Posted: 01 Apr 2022 10:22
by jimlad68
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.
Re: Query: count of multiple name occurances
Posted: 01 Apr 2022 10:59
by jimlad68
Updated attachment with more name cols and sort
Re: Query: count of multiple name occurances
Posted: 01 Apr 2022 15:06
by davidf
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?
Re: Query: count of multiple name occurances
Posted: 02 Apr 2022 10:00
by ississi
Ooh love you guys! Many thanks Jim, will have a play

Re: Query: count of multiple name occurances
Posted: 11 Apr 2022 08:32
by jelv
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.
Re: Query: count of multiple name occurances
Posted: 11 Apr 2022 08:50
by ississi
Thanks, John

Re: Query: count of multiple name occurances
Posted: 11 Apr 2022 08:54
by ississi
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.