Page 1 of 1
Common relationships between two people
Posted: 22 Mar 2022 19:23
by Gary Carson
I am trying to develop a query to find
only common ancestors between two persons (most specifically myself and my wife).
For example Jane Doe is my 3rd cousin 4 times removed and she is also my wife’s 10th cousin twice removed.
The base query I am using contains the following Row selection criteria:
- Add if spouse of [“Starting “Person”]. Include original individual
Add if an ancestor of anyone in the current result set.
Add if an descendant of anyone in the current result set.
Add if a spouse of anyone in current result set.
I want to restrict results to only persons that are related to myself and my wife. Could this then create a list of persons related to any two persons.
Re: Common relationships between two people
Posted: 22 Mar 2022 20:48
by tatewise
If you are looking for common direct line ancestors then the Rows tab filter needs to implement the following rule:
Add if this person is a direct ancestor of person A and is a direct ancestor of person B
Does that define who you are looking for?
If so then the IsAncestorOf(...) function used twice within =IsTrue( ... and ... ) should work.
However, it hinges on exactly what you mean by Common relationships between two people and only common ancestors which are not identical.
Re: Common relationships between two people
Posted: 22 Mar 2022 21:06
by Gary Carson
I am looking for a person that is a direct ancestor of person A and is a direct ancestor of person B. Hopefully I format the function you provided correctly.
Re: Common relationships between two people
Posted: 22 Mar 2022 21:26
by tatewise
If you get stuck then please ask, but I am of the opinion that a learning experience is worthwhile.
Checkout the Help pages for IsAncestorOf(...) and IsTrue(...)
Note that the first says: Takes 2 Individual records as parameters and returns TRUE if the 1st is the ancestor of the 2nd.
To identify person A and person B use the Record(...) function.
i.e. Record( 2, I ) identifies the Individual record with Record Id = 2
Re: Common relationships between two people
Posted: 22 Mar 2022 22:08
by Gary Carson
I agree on the learning experience. The last one you took me on helped.
Re: Common relationships between two people
Posted: 23 Mar 2022 00:03
by Gary Carson
Going back to the base query I am using contains the following Row selection criteria:
Add if spouse of [“Starting Person”]. Include original individual
Add if an ancestor of anyone in the current result set.
Add if an descendant of anyone in the current result set.
Add if a spouse of anyone in current result set.
The desired result is only indicated by the sample below:

- Picture2.jpg (18.24 KiB) Viewed 1899 times
When I use the following sole criteria in the Row tab, the resultant output is only descendants of the "Starting Person".
Add if =IsTrue(IsAncestorOf(["Starting Person"],) and IsAncestorOf(["Second Person"],)) is true
If combine criteria as follows:
Add if =IsTrue(IsAncestorOf(["Starting Person"],) and IsAncestorOf(["Second Person"],)) is true
Add if spouse of [“Starting Person”]. Include original individual
Add if an ancestor of anyone in the current result set.
Add if an descendant of anyone in the current result set.
Add if a spouse of anyone in current result set.
I seem to get all relatives and the same individual appears as:

- Picture1.jpg (17.55 KiB) Viewed 1902 times
Re: Common relationships between two people
Posted: 23 Mar 2022 10:26
by tatewise
Sorry, I should have been clearer. The only Rows tab filter needed is the =IsTrue( IsAncestorOf(...) and ... ) expression.
All those other Rows tab filters will override that one filter and include most ancestral relatives.
As you have discovered, you need a Starting Person and a Second Person to act as the two roots.
Remember that I specifically mentioned how the IsAncestorOf(...) parameters are applied:
The function "Takes 2 Individual records as parameters and returns TRUE if the 1st is the ancestor of the 2nd."
So, IsAncestorOf( ["Starting Person"], %INDI% ) returns TRUE if Starting Person is the ancestor of %INDI% current person.
Consider if that is what you need?
Re: Common relationships between two people
Posted: 23 Mar 2022 13:48
by Gary Carson
Using Add if =IsTrue(IsAncestorOf(["Starting Person"],%INDI%) and IsAncestorOf(["Second Person"],)) is true returns only descendants of Starting Person.
Am trying to check if relative of Starting Person is also relatives of Second Person.
What I want to eliminate is Target person is Starting Person's second cousin and Target person is Second Person's husband's second cousin. Where Starting Person and Second Person are husband and wife.
Looking for result like Picure2 in previous post, not Picture1.
Re: Common relationships between two people
Posted: 23 Mar 2022 14:22
by tatewise
You are missing the point regarding IsAncestorOf(...).
The function returns TRUE if the 1st parameter is an ancestor of the 2nd parameter.
So it returns TRUE if Starting Person parameter is an ancestor of %INDI% parameter.
i.e. This person %INDI% is a descendant of the Starting Person which is what you are getting listed.
Whereas, IsAncestorOf( %INDI%, ["Starting Person"] ) returns TRUE if this person %INDI% is an ancestor of Starting Person which is what you want.
What gets shown in the Result Set Columns depends on the Columns tab Expressions.
So your Picture1 and Picture2 queries must have different Columns tab Expressions.
Use whatever Expressions you used in the Query that produced Picture2.
Re: Common relationships between two people
Posted: 23 Mar 2022 14:38
by Gary Carson
=IsTrue(IsAncestorOf(%INDI%,["Starting Person"]) and IsAncestorOf(["Second Person"],)) returned no results. I guess I am just not getting correct expression.
Re: Common relationships between two people
Posted: 23 Mar 2022 14:47
by tatewise
Look at the second IsAncestorOf(...) function!
When does it return TRUE?
Re: Common relationships between two people
Posted: 23 Mar 2022 15:11
by Jane
You appear to be looking for all Blood Relations, rather than just ancestors. So would it not be simpler to simply prompt for the two people you want to compare and then test for DnaBloodRelation
So
Add if =DnaBloodRelation(["Person"], %INDI%) true
Exclude if =DnaBloodRelation(["Person2"], %INDI%) false
Re: Common relationships between two people
Posted: 23 Mar 2022 15:40
by tatewise
Quite possibly, which is why I said "it hinges on exactly what you mean by Common relationships between two people and only common ancestors which are not identical". Gary seems to be happy with the direct ancestors case.
Jane, does that pair of filters include all direct descendants of the two people, which in this thread are husband and wife?
Re: Common relationships between two people
Posted: 23 Mar 2022 16:16
by Gary Carson
I think I got off track. Blood relation is more correct; not just direct ancestors. My error in creating this confusion.
Re: Common relationships between two people
Posted: 23 Mar 2022 16:34
by Jane
Mike: It would, but only where the two people were the parents, so if not needed a simply exclude if descendants of "person" would remove them.
Re: Common relationships between two people
Posted: 23 Mar 2022 16:51
by tatewise
OK, to avoid prolonging the thread here are the
Rows tab filters based on Jane's suggestion:
Code: Select all
Exclude unless =DnaBloodRelation( ["Person1"], %INDI% ) is true
Exclude unless =DnaBloodRelation( ["Person2"], %INDI% ) is true
Exclude if =IsDescendantOf( %INDI%, ["Person1"] ) is true
Note that 2nd filter is 'inverse' of Jane's because there is no
is false option.
Re: Common relationships between two people
Posted: 23 Mar 2022 16:59
by Gary Carson
Thanks for everyone's patience.
Re: Common relationships between two people
Posted: 23 Mar 2022 17:06
by Gary Carson
That last criteria worked exactly as desired. Again, a special thanks.