* Adding 'Relationship to Root' to Query

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
avatar
rfj1001
Superstar
Posts: 291
Joined: 14 Dec 2003 18:11
Family Historian: V7
Location: Dorset, England
Contact:

Adding 'Relationship to Root' to Query

Post by rfj1001 »

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
User avatar
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

Post by tatewise »

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 )
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
avatar
rfj1001
Superstar
Posts: 291
Joined: 14 Dec 2003 18:11
Family Historian: V7
Location: Dorset, England
Contact:

Re: Adding 'Relationship to Root' to Query

Post by rfj1001 »

Thanks Mike, the first works just fine :)
avatar
Medows
Gold
Posts: 25
Joined: 16 May 2016 12:28
Family Historian: V7

Re: Adding 'Relationship to Root' to Query

Post by Medows »

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
avatar
jelv
Megastar
Posts: 597
Joined: 03 Feb 2020 22:57
Family Historian: V7
Location: Mere, Wiltshire

Re: Adding 'Relationship to Root' to Query

Post by jelv »

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)
John Elvin
avatar
Medows
Gold
Posts: 25
Joined: 16 May 2016 12:28
Family Historian: V7

Re: Adding 'Relationship to Root' to Query

Post by Medows »

Thank you John. That appears to have worked.
avatar
jelv
Megastar
Posts: 597
Joined: 03 Feb 2020 22:57
Family Historian: V7
Location: Mere, Wiltshire

Re: Adding 'Relationship to Root' to Query

Post by jelv »

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.
John Elvin
Post Reply