Page 1 of 1
Basic query to find number of (first) cousins of file root?
Posted: 17 Sep 2022 16:41
by Cor
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.
Re: Basic query to find number of (first) cousins of file root?
Posted: 17 Sep 2022 18:49
by TimTreeby
Try this query, may be a better way but does work.
Re: Basic query to find number of (first) cousins of file root?
Posted: 17 Sep 2022 19:50
by Cor
Yes, that does work! Thank you very much. Now I just need to understand why and how it works!
Re: Basic query to find number of (first) cousins of file root?
Posted: 21 Sep 2022 08:34
by jelv
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.
Re: Basic query to find number of (first) cousins of file root?
Posted: 28 Sep 2022 09:20
by Little.auk
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.
Re: Basic query to find number of (first) cousins of file root?
Posted: 28 Sep 2022 09:39
by jelv
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!
Re: Basic query to find number of (first) cousins of file root?
Posted: 28 Sep 2022 09:53
by Little.auk
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.
Re: Basic query to find number of (first) cousins of file root?
Posted: 28 Sep 2022 10:04
by LornaCraig
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.
Re: Basic query to find number of (first) cousins of file root?
Posted: 28 Sep 2022 10:38
by Little.auk
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!