I'm trying to improve how I can utilise FH to improve my DNA research and, probably like everyone else, I've got lots of 4th to 6th cousins spread in many areas of my tree. They all have DNA info, such as testing company, shared segments and emerging or actual MRCA entered in their record. They all also have a common flag, so the subset easily identified.
What I'm trying to do is create a query that shows the relationship of anyone in that group to the root person (who will be one of the DNA matches).
I've got all the query working except I can't seem to find out how to add the most important part - a 'Relationship to Root' column.
Any help would be appreciated.
Thanks
* Adding 'Relationship to Root' to Query
- tatewise
- Megastar
- Posts: 28414
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Adding 'Relationship to Root' to Query
You need to use the =Relationship(...) function.
That identifies two Individual records whose relationship is required.
Usually, the two records are the FileRoot() and the current %INDI%
e.g. =Relationship( FileRoot(), %INDI%, TEXT, 1 )
But to identify a specific 'root' record other than the File Root use Record( 234, "I" ) where 234 is the Record Id of an "I" Individual record.
e.g. =Relationship( Record( 234, "I" ), %INDI%, TEXT, 1 )
But perhaps you are choosing that DNA root person via a prompt in the Query?
In that case use ["DNA Root"] where the prompt is for the DNA Root person.
e.g. =Relationship( ["DNA Root"], %INDI%, TEXT, 1 )
That identifies two Individual records whose relationship is required.
Usually, the two records are the FileRoot() and the current %INDI%
e.g. =Relationship( FileRoot(), %INDI%, TEXT, 1 )
But to identify a specific 'root' record other than the File Root use Record( 234, "I" ) where 234 is the Record Id of an "I" Individual record.
e.g. =Relationship( Record( 234, "I" ), %INDI%, TEXT, 1 )
But perhaps you are choosing that DNA root person via a prompt in the Query?
In that case use ["DNA Root"] where the prompt is for the DNA Root person.
e.g. =Relationship( ["DNA Root"], %INDI%, TEXT, 1 )
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
-
- Superstar
- Posts: 291
- Joined: 14 Dec 2003 18:11
- Family Historian: V7
- Location: Dorset, England
- Contact:
Re: Adding 'Relationship to Root' to Query
Thanks Mike, the first works just fine
Re: Adding 'Relationship to Root' to Query
Hi Mike,
I am a newbie to FH so still trying to understand data flow between the different query types. I have a Fact Query but I wanted to add a relationship to the root so I could prioritize my research. I applied "=Relationship( FileRoot(), %INDI%, TEXT, 1 )" to a Fact Query but got an error "Invalid expression for the current query type".
Alan
I am a newbie to FH so still trying to understand data flow between the different query types. I have a Fact Query but I wanted to add a relationship to the root so I could prioritize my research. I applied "=Relationship( FileRoot(), %INDI%, TEXT, 1 )" to a Fact Query but got an error "Invalid expression for the current query type".
Alan
Re: Adding 'Relationship to Root' to Query
As it is a fact query there isn't a current individual to use the expression you have so you have to get the owner of the fact. Try this:
=Relationship(FileRoot(),FactOwner(,1,MALES_FIRST),TEXT,1)
=Relationship(FileRoot(),FactOwner(,1,MALES_FIRST),TEXT,1)
John Elvin
Re: Adding 'Relationship to Root' to Query
Thank you John. That appears to have worked.
Re: Adding 'Relationship to Root' to Query
Glad that helped.
When you have an issue like this it's always worth looking at the coding of the standard queries to see if they offer clues. I knew what was wrong with what you had, but had to look at the existing Facts and Events queries to get a clue to the solution.
When you have an issue like this it's always worth looking at the coding of the standard queries to see if they offer clues. I knew what was wrong with what you had, but had to look at the existing Facts and Events queries to get a clue to the solution.
John Elvin