* DNABloodRelation expression

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
Kingy
Diamond
Posts: 60
Joined: 15 Dec 2020 10:33
Family Historian: V7
Location: Essex, UK

DNABloodRelation expression

Post by Kingy » 15 Dec 2020 10:42

Hi

I hope this is ok, as new here.

I am trying to use the new DNABloodRelation expression ( =DnaBloodRelation(%CUR_TREE_ROOT%,%INDI%) ) to show the blood icon for all blood relatives of an individual.

The built in expression works well but displays for the individual on whom the diagram is built, but I would like to lock this to a single individual. I have tried using the =Hasflag(,["flag"] ) is true using the focus flag for the individual, but whatever I try I get an error Expession is invalid.

Is it possible to do what I am trying to do? Any help appreciated.

Thanks

User avatar
tatewise
Megastar
Posts: 27079
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: DNABloodRelation expression

Post by tatewise » 15 Dec 2020 11:38

Do you mean you want to use somebody other than the %CUR_TREE_ROOT%?

You can use =FileRoot() which relates to whoever is the current File Root person.
i.e. The person in focus in the Focus Window when you click the Home button.

You can use a specific Record Id where =Record( 99, "I" ) is the Individual with Record Id = 99.

BTW: When choosing parameters for a function it is important to get their data type correct.
All the above alternatives provide an Individual record reference which is what the DNABloodRelation requires:
Parameter 1: A reference to an Individual record.

Whereas, =HasFlag(...) returns a Boolean true or false which is the wrong data type.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

avatar
Kingy
Diamond
Posts: 60
Joined: 15 Dec 2020 10:33
Family Historian: V7
Location: Essex, UK

Re: DNABloodRelation expression

Post by Kingy » 15 Dec 2020 12:13

Thanks

I have tried =DnaBloodRelation(=Record (1 "I"),%INDI%) but that gives error message each time, but the FileRoot method works fine.

That is a great help but I was hoping to do it for 2 individuals, so I assumed that using the record ID I could add 2 expresssions one for each person. So if you can see what I am doing wrong on that one it would help.

Thanks for help so far, greatly appreciated

User avatar
tatewise
Megastar
Posts: 27079
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: DNABloodRelation expression

Post by tatewise » 15 Dec 2020 12:39

When using a function as a parameter you must omit its leading = sign as you must have done with FileRoot().
You also forgot the comma between 1 and "I" parameters.

=DnaBloodRelation( Record( 1 , "I" ), %INDI% )

It is a pity that FH does not provide a basic syntax check feedback report.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

avatar
Kingy
Diamond
Posts: 60
Joined: 15 Dec 2020 10:33
Family Historian: V7
Location: Essex, UK

Re: DNABloodRelation expression

Post by Kingy » 15 Dec 2020 12:57

Excellent, thanks ever so much. :D :D :D

Paul

avatar
Kingy
Diamond
Posts: 60
Joined: 15 Dec 2020 10:33
Family Historian: V7
Location: Essex, UK

Re: DNABloodRelation expression

Post by Kingy » 19 Feb 2021 17:04

Mike

I am just playing with this in the text scheme. The default is
=Text(FormatFloat(DnaRelatedness(%CUR_DGM_ROOT%,%INDI%) * Float(100),2,16) . "% atDNA")

But as we did above I want it to be locked to myself as an Individual and not the current root, so I have tried
=Text(FormatFloat(DnaRelatedness(Record(1,”I”),%INDI%) * Float(100),2,16) . "% atDNA")
but this is rejected each time.

Can you see where I am going wrong or will this not work as I am hoping.

Regards

User avatar
tatewise
Megastar
Posts: 27079
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: DNABloodRelation expression

Post by tatewise » 19 Feb 2021 18:08

It seems to work for me as long as the quotes are simple quotes and not smart quotes.
If you look closely your quotes are different from the ones in the earlier posting.
Did you compose the expression in a word-processor that typically use smart quotes?
In the Text Scheme Template expression delete the quotes and enter them again from the keyboard.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

avatar
Kingy
Diamond
Posts: 60
Joined: 15 Dec 2020 10:33
Family Historian: V7
Location: Essex, UK

Re: DNABloodRelation expression

Post by Kingy » 19 Feb 2021 18:45

Yes working now, another lesson learnt.

Thanks
Paul

Post Reply