* Relationships

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.
avatar
Maccbob
Newbie
Posts: 2
Joined: 27 Feb 2023 20:45
Family Historian: V7

Relationships

Post by Maccbob » 21 Jul 2023 16:22

Is there a way of displaying a relationship to root person box in the Indvidual Property Box at the top above the Name box on the main tab

User avatar
BillH
Megastar
Posts: 2179
Joined: 31 May 2010 03:40
Family Historian: V7
Location: Washington State, USA

Re: Relationships

Post by BillH » 21 Jul 2023 16:31

Go to Tools > Preferences and select Property Box and then Captions and add this to the first box:

[=Relationship(FileRoot(),,TEXT,1)]

Bill

avatar
Maccbob
Newbie
Posts: 2
Joined: 27 Feb 2023 20:45
Family Historian: V7

Re: Relationships

Post by Maccbob » 21 Jul 2023 16:48

Brilliant thank you Bill

User avatar
fhtess65
Megastar
Posts: 525
Joined: 15 Feb 2018 21:34
Family Historian: V7
Location: British Columbia, Canada
Contact:

Re: Relationships

Post by fhtess65 » 22 Jul 2023 15:41

That works a treat!!!
BillH wrote:
21 Jul 2023 16:31
Go to Tools > Preferences and select Property Box and then Captions and add this to the first box:

[=Relationship(FileRoot(),,TEXT,1)]

Bill
---
Teresa Basińska Eckford
Librarian & family historian
http://writingmypast.wordpress.com
Researching: Spong, Ferdinando, Taylor, Lawley, Sinkins, Montgomery; Basiński, Hilferding, Ratowski, Paszkiewicz

avatar
arthurk
Superstar
Posts: 339
Joined: 31 Jan 2015 20:24
Family Historian: V7

Re: Relationships

Post by arthurk » 22 Jul 2023 16:22

BillH wrote:
21 Jul 2023 16:31
Go to Tools > Preferences and select Property Box and then Captions and add this to the first box:

[=Relationship(FileRoot(),,TEXT,1)]
Thanks - but please could you (or someone else) explain what the different parts are actually doing? In the program Help, under Functions > FileRoot, there's a simpler term:

=Relationship(FileRoot())

This seems to produce the same result - or are there cases that I haven't found where it doesn't?

Another query:
Without getting very complicated, is it possible to capitalise the relationship (eg Father rather than father), in the same way as in the name box at the top of the Focus Window?

User avatar
BillH
Megastar
Posts: 2179
Joined: 31 May 2010 03:40
Family Historian: V7
Location: Washington State, USA

Re: Relationships

Post by BillH » 22 Jul 2023 17:02

The different parts are defined in the Help under the Relationship function.

https://www.family-historian.co.uk/help ... nship.html

User avatar
Jane
Site Admin
Posts: 8440
Joined: 01 Nov 2002 15:00
Family Historian: V7
Location: Somerset, England
Contact:

Re: Relationships

Post by Jane » 22 Jul 2023 17:24

To uppercase the first character you can use:

Code: Select all

=Text(ToUpper(LeftText(Relationship(FileRoot(),,TEXT,1),1,"")) . MidText(Relationship(FileRoot(),,TEXT,1),2,0))
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."

avatar
arthurk
Superstar
Posts: 339
Joined: 31 Jan 2015 20:24
Family Historian: V7

Re: Relationships

Post by arthurk » 22 Jul 2023 18:46

BillH wrote:
22 Jul 2023 17:02
The different parts are defined in the Help under the Relationship function.

https://www.family-historian.co.uk/help ... nship.html
Thanks, Bill. I see that the Relationship function requires 4 parameters, the first two being references to Individuals, but in the version you've given the second one is empty. Please could you explain that?

Also, if the function requires 4 parameters, why does the simpler =Relationship(FileRoot()) apparently work OK?

avatar
arthurk
Superstar
Posts: 339
Joined: 31 Jan 2015 20:24
Family Historian: V7

Re: Relationships

Post by arthurk » 22 Jul 2023 18:54

Jane wrote:
22 Jul 2023 17:24
To uppercase the first character you can use:

Code: Select all

=Text(ToUpper(LeftText(Relationship(FileRoot(),,TEXT,1),1,"")) . MidText(Relationship(FileRoot(),,TEXT,1),2,0))
Thanks, Jane - I thought there might be a way, but it would have taken me a while to find it by myself.

User avatar
BillH
Megastar
Posts: 2179
Joined: 31 May 2010 03:40
Family Historian: V7
Location: Washington State, USA

Re: Relationships

Post by BillH » 22 Jul 2023 19:07

arthurk wrote:
22 Jul 2023 18:46

Thanks, Bill. I see that the Relationship function requires 4 parameters, the first two being references to Individuals, but in the version you've given the second one is empty. Please could you explain that?
I think the function allows you to specify two individuals and it would give the relationship between them. I have never done this... so don't know how to code that. To be honest, I really don't know how it works. Someone gave me the code that I posted.
Also, if the function requires 4 parameters, why does the simpler =Relationship(FileRoot()) apparently work OK?
I guess if you don't specify all 4 parameters, then it uses some defaults. I'm not really sure.

Bill

avatar
arthurk
Superstar
Posts: 339
Joined: 31 Jan 2015 20:24
Family Historian: V7

Re: Relationships

Post by arthurk » 22 Jul 2023 19:16

Thanks - and hopefully someone else will be able to explain.

I'm not trying to be awkward, just wanting to understand, so when a term doesn't conform to what's described in Help I'm curious to know why it still works. Also why there are two versions - the simple one and the one with 4 parameters.

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

Re: Relationships

Post by tatewise » 22 Jul 2023 20:25

Unfortunately, the function documentation often does not explain that some parameters have default values which are used if explicit values are omitted. Also, sometimes parameters are optional.

In the case of Relationship(...) the first two parameters reference the individual records whose relationship is required.
By default, the current individual record is used if either parameter is omitted.

The third parameter defaults to TEXT and the fourth parameter defaults to 1.
Typically, the first value described in the documentation is the default value.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
BillH
Megastar
Posts: 2179
Joined: 31 May 2010 03:40
Family Historian: V7
Location: Washington State, USA

Re: Relationships

Post by BillH » 22 Jul 2023 21:38

Mike,

If you want to find the relationship between two individuals, how do you code the individuals in the function?

Thanks,
Bill
Last edited by tatewise on 23 Jul 2023 09:40, edited 1 time in total.
Reason: Corrected the 2nd/3rd 3rd/4th parameter wording

User avatar
Jane
Site Admin
Posts: 8440
Joined: 01 Nov 2002 15:00
Family Historian: V7
Location: Somerset, England
Contact:

Re: Relationships

Post by Jane » 23 Jul 2023 07:55

The help for the function does detail the 4 parameters. The 1st and 2nd parameters will default to the current record when using a query so %INDI% and the example for using relationship does show all 4 parameters in use.

See
https://www.family-historian.co.uk/help ... nship.html

So you can also say

=Relationship(,FileRoot(),TEXT,1)

To get the relationship of the file root to the current person.
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."

avatar
arthurk
Superstar
Posts: 339
Joined: 31 Jan 2015 20:24
Family Historian: V7

Re: Relationships

Post by arthurk » 23 Jul 2023 09:41

Thanks for the explanations - I can see what's going on better now.

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

Re: Relationships

Post by tatewise » 23 Jul 2023 09:50

BillH wrote:
22 Jul 2023 21:38
If you want to find the relationship between two individuals, how do you code the individuals in the function?
There are many ways to reference Individual records such as:
  • %INDI% refers to the current Individual record if the context allows it.
  • FileRoot() refers to the File Root Individual record which can be redefined from time to time.
  • %CUR_FILE_OWNER% and %CUR_FILE_HEADER% refer to the Project owner and Header.
  • Record( 345, "I" ) refers to an Individual record with Record Id 345.
  • %INDI.~SPOU[2]% or %INDI.~CHIL[2]% and similar shortcuts refer to Individual records close to the current Individual.
  • Plus many other data references to Individual records.
BTW: Those generally apply anywhere that an Individual record reference is required in a function.

However, a major omission from the Help for most functions is an explanation of what values are the defaults when the parameter is omitted. Perhaps that should be reported to CP or added as Wish List Request.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
BillH
Megastar
Posts: 2179
Joined: 31 May 2010 03:40
Family Historian: V7
Location: Washington State, USA

Re: Relationships

Post by BillH » 23 Jul 2023 15:28

tatewise wrote:
23 Jul 2023 09:50

There are many ways to reference Individual records such as:
<snip>
Plus many other data references to Individual records.
Mike,

Thanks for that. I looked all over for a list like this. The help for Relationship didn't mention what could be used. Are these other data references to Individual records listed somewhere?

Thanks,
Bill

avatar
arthurk
Superstar
Posts: 339
Joined: 31 Jan 2015 20:24
Family Historian: V7

Re: Relationships

Post by arthurk » 23 Jul 2023 16:31

I'm on a different tack from Bill, so apologies for seeming to butt in, but it does all stem from the original question.

This thread has emboldened me to improve my Property Box caption to include a number of variables. In case anyone would like to copy or adapt it, this is the code for the whole of the caption:

Code: Select all

%INDI%=CombineText(" (", %INDI.NAME[1]._USED%,")",)=CombineText(" ('", %INDI.NAME[1].NICK%,"')",) [=Text(ToUpper(LeftText(Relationship(FileRoot(),,TEXT,1),1,"")) . MidText(Relationship(FileRoot(),,TEXT,1),2,0))]=CombineText(" (", %INDI.REFN[1]%,")",)
As an example, my great grandfather's caption shows his Name, Nickname, Relationship to me, and his Custom ID:
Screenshot 2023-07-23 165856.jpg
Screenshot 2023-07-23 165856.jpg (25.44 KiB) Viewed 1064 times

For someone not directly related to me (hence the empty [ ]) it shows his Name and the Name he was known by. Because of the way I do things there's also no Custom ID.
Screenshot 2023-07-23 170847.jpg
Screenshot 2023-07-23 170847.jpg (16.19 KiB) Viewed 1064 times

Many thanks to all those who have helped me with this.

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

Re: Relationships

Post by tatewise » 24 Jul 2023 10:09

BillH wrote:
23 Jul 2023 15:28
Thanks for that. I looked all over for a list like this. The help for Relationship didn't mention what could be used. Are these other data references to Individual records listed somewhere?
Those Data References won't be listed in the Help for any functions because they apply globally throughout FH.
It would be very repetitive to list them everywhere they might be useful.

Most of them are included in Understanding Data References or the Help page it refers to.
The trick to discovering most of them is to use the Data Reference Assistance provide with almost all Expression boxes.
One of the easiest to use is the Fields pane on the left of the Query Columns tab.
e.g. Run the Query > Relatives and Relationships > All Individuals and open its Columns tab.
In the tiny droplist Menu bottom left choose Show Both in Box then select any of the last 8 entries in the Fields pane.
The Data Reference in the Box can be copied to any Expression.

The only options not listed by the method above are functions such as FileRoot() and Record(...) which you just have to learn.
However, the Dat Ref %CUR_FILE_ROOT% is the same as function FileRoot().
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
BillH
Megastar
Posts: 2179
Joined: 31 May 2010 03:40
Family Historian: V7
Location: Washington State, USA

Re: Relationships

Post by BillH » 24 Jul 2023 16:01

Mike,

Thanks.

Bill

User avatar
ississi
Diamond
Posts: 59
Joined: 15 Feb 2021 14:47
Family Historian: V7

Re: Relationships

Post by ississi » 26 Jul 2023 11:01

Many thanks, BillH, that's great!

If you're interested in the relationship to a particular individual who may not be the root (I had to change my root for a bit, away from myself, because I'm female. I had to change it to a man, either something to do with charting or with queries, can't remember), then you need (for the simple caption):

Code: Select all

[=Relationship(Record(personid,"I"),,TEXT,1)]
where personid is their number, eg:

Code: Select all

[=Relationship(Record(390,"I"),,TEXT,1)]
Thank you tatewise for the clue.

User avatar
BillH
Megastar
Posts: 2179
Joined: 31 May 2010 03:40
Family Historian: V7
Location: Washington State, USA

Re: Relationships

Post by BillH » 26 Jul 2023 15:40

Thanks ississi, I'll give it a try.

Bill

avatar
arishmell
Famous
Posts: 100
Joined: 29 Jan 2005 19:13
Family Historian: V7

Re: Relationships

Post by arishmell » 11 Aug 2023 05:04

I'm pleased with this new ability to display the relationship to root at the top of the Property Box. Now I'm wondering, is there any way to distinguish paternal/maternal lines as well? That would be such a help, especialy when there are common names on both sides.
Maureen

Researching:
Waycott, Fewings, Piper, Burgoyne, Johns, Phillips, Paddon, Streat;
Morrish, Rowd*n, Pike, Lowder, Flood, Parsons and others.
All in glorious Devon!

avatar
arthurk
Superstar
Posts: 339
Joined: 31 Jan 2015 20:24
Family Historian: V7

Re: Relationships

Post by arthurk » 11 Aug 2023 10:42

arishmell wrote:
11 Aug 2023 05:04
Now I'm wondering, is there any way to distinguish paternal/maternal lines as well?
Someone might have a more sophisticated answer, but that's what I do with the Custom ID - up to a point. It's included in the code I posted on 23 July, 17:31 (UK).

All my direct ancestors from grandparents backwards have what is essentially an ahnentafel number based on their relationship to the grandparent concerned, preceded by the first letter of that grandparent's surname. I could in theory develop that so as to make derivative numbers for siblings and their descendants, but I've never felt the need.

If you wanted to use the Custom ID, there's probably an automatic way of inserting a paternal/maternal indicator, but it would take me much longer to work this out than for others to simply tell you. Or (thinking aloud as this isn't something I've tried) might it be possible to incorporate an appropriate wingding or other text-based icon in the caption, depending on which line someone comes from? Or something based on flags?

User avatar
sbell95
Famous
Posts: 107
Joined: 14 Feb 2021 06:04
Family Historian: V7
Location: Australia

Re: Relationships

Post by sbell95 » 12 Aug 2023 02:08

I've just had a play around with captions, expressions and data references, and this is the closest I could come to distinguishing maternal/paternal lines:

Code: Select all

=TextIf(DnaBloodRelation(Record(2),%INDI%), "Paternal", "Maternal")
where record ID 2 represents my father.

The only problem is that now my husband's entire line is marked as "Maternal" :lol:

I echo Arthur's sentiment that someone probably has a more sophisticated solution!
Sarah Bell – Australia
View my tree on Wikitree

Post Reply