* Help with query to list 1st cousins of selected person
Help with query to list 1st cousins of selected person
I'm managed to write a custom query to list all first cousins of a specified person by adapting an existing query using the expressions:
Addif =Relationship(["Starting Person"],,TEXT,1) matches 'cousin'
& then excluding if they are not direct cousins (ie husband or wife of a cousin)
I don't consider it to be very elegant & think there may be a better way of doing it but it suffices for now.
But I've now quite stuck on modifying it to only have paternal cousins or maternal cousins not both - ie children of one's father's siblings & also of one's mother's siblings.
This can be 2 separate queries, although I suspect it could be in future combined into 1 by having a 2nd input parameter such as paternal or maternal or similar but, at present, that can wait.
And before anyone asks why I want such a list, Irish families can be HUGE and my wife has 89 first cousins and 77 of them are still alive ranging from age 52 to 85.
(And >4000 relatives and counting !!!)
I've had several attempts at it but with no success so I, & in particular my wife, would be so grateful for some help.
I've been using Family Historian for quite sometime, but only now in lockdown do I have the time to try to get to grips with it and produce more meaningful diagrams & reports. I've searched the help, tutorials & forums but still can't work out how to 'code' it even though I think it can't be that difficult.
So thanks in advance for any help any of you experts out there can give me
Addif =Relationship(["Starting Person"],,TEXT,1) matches 'cousin'
& then excluding if they are not direct cousins (ie husband or wife of a cousin)
I don't consider it to be very elegant & think there may be a better way of doing it but it suffices for now.
But I've now quite stuck on modifying it to only have paternal cousins or maternal cousins not both - ie children of one's father's siblings & also of one's mother's siblings.
This can be 2 separate queries, although I suspect it could be in future combined into 1 by having a 2nd input parameter such as paternal or maternal or similar but, at present, that can wait.
And before anyone asks why I want such a list, Irish families can be HUGE and my wife has 89 first cousins and 77 of them are still alive ranging from age 52 to 85.
(And >4000 relatives and counting !!!)
I've had several attempts at it but with no success so I, & in particular my wife, would be so grateful for some help.
I've been using Family Historian for quite sometime, but only now in lockdown do I have the time to try to get to grips with it and produce more meaningful diagrams & reports. I've searched the help, tutorials & forums but still can't work out how to 'code' it even though I think it can't be that difficult.
So thanks in advance for any help any of you experts out there can give me
- tatewise
- Megastar
- Posts: 27082
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Help with query to list 1st cousins of selected person
I think the solution involves checking for a common grandparent family.
So consider the Starting Person's father's parent family.
If a cousin via either their father or mother has the same grandparent family then they are a paternal cousin.
The Starting Person's father's parent family is:
=Field( Individual( ["Starting Person"] ), 'INDI.~FATH>FAMC>' )
The cousin's father's and mother's grandparent families are:
%INDI.~FATH>FAMC>% and %INDI.~MOTH>FAMC>%
So to compare them to check if they are same use Add if expression is true for both:
=IsSameItem( Field( Individual( ["Starting Person"] ), 'INDI.~FATH>FAMC>' ), %INDI.~FATH>FAMC>% )
and
=IsSameItem( Field(Individual( ["Starting Person"] ), 'INDI.~FATH>FAMC>' ), %INDI.~MOTH>FAMC>% )
Finally, Exclude unless =Relationship( ["Starting Person"], , TEXT, 1 ) matches 'cousin'
The maternal case is the same except using =Field( Individual( ["Starting Person"] ), 'INDI.~MOTH>FAMC>' )
These all assume the natural birth parent families are the 1st FAMC.
So consider the Starting Person's father's parent family.
If a cousin via either their father or mother has the same grandparent family then they are a paternal cousin.
The Starting Person's father's parent family is:
=Field( Individual( ["Starting Person"] ), 'INDI.~FATH>FAMC>' )
The cousin's father's and mother's grandparent families are:
%INDI.~FATH>FAMC>% and %INDI.~MOTH>FAMC>%
So to compare them to check if they are same use Add if expression is true for both:
=IsSameItem( Field( Individual( ["Starting Person"] ), 'INDI.~FATH>FAMC>' ), %INDI.~FATH>FAMC>% )
and
=IsSameItem( Field(Individual( ["Starting Person"] ), 'INDI.~FATH>FAMC>' ), %INDI.~MOTH>FAMC>% )
Finally, Exclude unless =Relationship( ["Starting Person"], , TEXT, 1 ) matches 'cousin'
The maternal case is the same except using =Field( Individual( ["Starting Person"] ), 'INDI.~MOTH>FAMC>' )
These all assume the natural birth parent families are the 1st FAMC.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
Re: Help with query to list 1st cousins of selected person
Fantastic Mike
I was on the right track but I hadn't thought of comparing the Family but was looking at the individual grandparents.
I'm learning something new every day and I am so impressed with the help given by persons like yourselves on this forum. It really confirms my views all along that Family Historian is by far and away the best program for genealogy research. If only I could persuade my brother who persists in using Family Tree Maker !!!
I was on the right track but I hadn't thought of comparing the Family but was looking at the individual grandparents.
I'm learning something new every day and I am so impressed with the help given by persons like yourselves on this forum. It really confirms my views all along that Family Historian is by far and away the best program for genealogy research. If only I could persuade my brother who persists in using Family Tree Maker !!!
- tatewise
- Megastar
- Posts: 27082
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Help with query to list 1st cousins of selected person
I think it would work comparing individual grandparents, but is unnecessary, and makes the data references longer.
Update the Starting Person's parent to prompt for FATH or MOTH and you can get either paternal or maternal cousins:
GetField( Individual( ["Starting Person"] ), "INDI.~" . ["FATH/MOTH"] . ">FAMC>" )
Update the Starting Person's parent to prompt for FATH or MOTH and you can get either paternal or maternal cousins:
GetField( Individual( ["Starting Person"] ), "INDI.~" . ["FATH/MOTH"] . ">FAMC>" )
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
- Jane
- Site Admin
- Posts: 8441
- Joined: 01 Nov 2002 15:00
- Family Historian: V7
- Location: Somerset, England
- Contact:
Re: Help with query to list 1st cousins of selected person
Another way to do this is use the Relationship codes.
A first cousin is always related 2 gens up and 2 gens down.
So
Add all Ancestors
Add all Descendants
Exclude unless =RelationCode(["Starting Person"],,GENS_UP,1) = 2
Exclude unless =RelationCode(["Starting Person"],,GENS_DOWN,1) = 2
A first cousin is always related 2 gens up and 2 gens down.
So
Add all Ancestors
Add all Descendants
Exclude unless =RelationCode(["Starting Person"],,GENS_UP,1) = 2
Exclude unless =RelationCode(["Starting Person"],,GENS_DOWN,1) = 2
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."
- tatewise
- Megastar
- Posts: 27082
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Help with query to list 1st cousins of selected person
Yes, but Exclude unless =Relationship( ["Starting Person"], , TEXT, 1 ) matches 'cousin' is much neater & concise.
It was paternal versus maternal branch that he needed help with.
Anyway, the Expressions need enclosing IsTrue(...) like this:
=IsTrue(RelationCode(["Starting Person"],,GENS_DOWN,1) = 2)
It was paternal versus maternal branch that he needed help with.
Anyway, the Expressions need enclosing IsTrue(...) like this:
=IsTrue(RelationCode(["Starting Person"],,GENS_DOWN,1) = 2)
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
- Jane
- Site Admin
- Posts: 8441
- Joined: 01 Nov 2002 15:00
- Family Historian: V7
- Location: Somerset, England
- Contact:
Re: Help with query to list 1st cousins of selected person
> Anyway, the Expressions need enclosing IsTrue(...)
Actually it does not.
Actually it does not.
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."
- tatewise
- Megastar
- Posts: 27082
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Help with query to list 1st cousins of selected person
Ah, yes! 
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry