Page 1 of 1

Relationship expression

Posted: 11 Aug 2022 06:36
by laz_gen
I have created a custom DNA fact that I have attached to various individuals in my records. I would like the fact sentence to show the relationship between that individual owning the DNA fact and myself as a fixed individual.

I have found the Relationship function =Relationship(["Individual"],%INDI%,TEXT,1) and have tried various combinations but with no luck.

There are some mentions on the forum of such an expression to the root person =Relationship(FileRoot()) but I often move the Root Person depending on which branch or group of people I am working on, so need the expression anchored on myself.

I would like the expression to produce a sentence such as "Jane Doe is the third cousin once removed of John Doe", with Jane Doe being the fact owner and John Doe being myself.

I have my wife and her family in the same project and she has also undertaken a DNA test so I would like to extend this to her family with a separate DNA fact.

All help appreciated.

Re: Relationship expression

Posted: 11 Aug 2022 06:44
by Jane
Have you tried

Code: Select all

=Relationship(Record(9999,'I'),%INDI%,TEXT,1)
Where 9999 is your record ID?

Re: Relationship expression

Posted: 11 Aug 2022 09:26
by tatewise
Unfortunately the %INDI% data reference does not work in the Sentence Template context and %CUR_PRIN% must be used.
Also, the function needs to be enclosed in { curly brackets }.
i.e.
{=Relationship( Record(9999,"I"), %CUR_PRIN%, TEXT, 1 )}

The full Sentence Template would then be:

{%CUR_PRIN%} is the {=Relationship( Record(9999,"I"), %CUR_PRIN%, TEXT, 1 )} of {=Record(9999,"I")}

where 9999 is the Record Id of your record in one case and your wife's record in the other case.

See the Help for Understanding Data References and Relationship Functions for further details.

Re: Relationship expression

Posted: 11 Aug 2022 09:34
by laz_gen
Jane
I tried your suggestion but I couldn't get it to work even adding curly brackets as I found mentioned in the help file.

Mike
I just saw your reply and that works perfectly


Thanks to you both