* Basic query to find number of (first) cousins of file root?

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
Cor
Newbie
Posts: 4
Joined: 13 May 2016 11:20
Family Historian: V7
Location: Kenya

Basic query to find number of (first) cousins of file root?

Post by Cor » 17 Sep 2022 16:41

Hi, I'm very much an amateur user compared to some of the power users in this forum but I'd like to up my game! My sisters recently asked me how many (first) cousins our late mother had. I know it was 50+ but I'd like to list them precisely and thought it would be quite straightforward using Query and making my mum the file root. Unfortunately I couldn't get my head around the logic of how to set up a Query report. If someone could help me, I'd be really grateful. Thank you.

avatar
TimTreeby
Famous
Posts: 168
Joined: 12 Sep 2003 14:56
Family Historian: V6.2
Location: Ogwell, Devon
Contact:

Re: Basic query to find number of (first) cousins of file root?

Post by TimTreeby » 17 Sep 2022 18:49

Try this query, may be a better way but does work.
Cousin Query.fhq
(6.2 KiB) Downloaded 102 times

User avatar
Cor
Newbie
Posts: 4
Joined: 13 May 2016 11:20
Family Historian: V7
Location: Kenya

Re: Basic query to find number of (first) cousins of file root?

Post by Cor » 17 Sep 2022 19:50

Yes, that does work! Thank you very much. Now I just need to understand why and how it works!

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

Re: Basic query to find number of (first) cousins of file root?

Post by jelv » 21 Sep 2022 08:34

Is there a way to refer to the current focus individual in a query? If there was that would make this query much more user friendly.
John Elvin

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

Re: Basic query to find number of (first) cousins of file root?

Post by Little.auk » 28 Sep 2022 09:20

The Row Filter in this query is over-complicated.

The single filter expression Exclude unless =Relationship(["Starting Person"],,TEXT,1) matches 'Cousin' is all that is needed, and can be easily adapted for any other relationship.

Say, for example I wanted to list all my Uncles and Aunts in one query then modify the first expression and add the "Add If" expression.

Exclude unless =Relationship(["Starting Person"],,TEXT,1) matches 'Uncle'
Add if =Relationship(["Starting Person"],,TEXT,1) matches 'Aunt'

So you first exclude anyone who is not an "Uncle" then add back in anyone who is an Aunt.

Note, however, that this only includes direct blood relative Uncles and Aunts and not their spouses.
Last edited by Little.auk on 28 Sep 2022 09:40, edited 1 time in total.
Peter Rollin
Running FH 7.0.20 and AS 7.7.7 64 bit in Windows 11

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

Re: Basic query to find number of (first) cousins of file root?

Post by jelv » 28 Sep 2022 09:39

Little.auk wrote:
28 Sep 2022 09:20
The Row Filter in this query is over-complicated.

The single filter expression Exclude unless =Relationship(["Starting Person"],,TEXT,1) matches 'Cousin' is all that is needed, and can be easily adapted for any other relationship.
A lot simpler, but ...

It doesn't find half cousins whereas the original does!
John Elvin

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

Re: Basic query to find number of (first) cousins of file root?

Post by Little.auk » 28 Sep 2022 09:53

I don't have any half cousins in my tree, so don't have an example to see how FH treats that Relationship.

If FH lists them as "Half Cousin" then the simple "Add if" second expression is all that is needed to include them in the query.
Peter Rollin
Running FH 7.0.20 and AS 7.7.7 64 bit in Windows 11

User avatar
LornaCraig
Megastar
Posts: 2989
Joined: 11 Jan 2005 17:36
Family Historian: V7
Location: Oxfordshire, UK

Re: Basic query to find number of (first) cousins of file root?

Post by LornaCraig » 28 Sep 2022 10:04

As a matter of interest, in the uncles and aunts query why did you use Exclude unless for uncles and Add if for aunts? It works, but both lines could be Add if.

Similarly in the cousins qurey, Add if... cousin and Add if... half cousin.
Lorna

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

Re: Basic query to find number of (first) cousins of file root?

Post by Little.auk » 28 Sep 2022 10:38

LornaCraig wrote:
28 Sep 2022 10:04
As a matter of interest, in the uncles and aunts query why did you use Exclude unless for uncles and Add if for aunts? It works, but both lines could be Add if.
It's gotten to be a habit! Using Exclude unless in the first filter expression seems appropriate as a reminder that I am leaving a lot of records out!
Peter Rollin
Running FH 7.0.20 and AS 7.7.7 64 bit in Windows 11

Post Reply