* Relationships
Relationships
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
- BillH
- Megastar
- Posts: 2179
- Joined: 31 May 2010 03:40
- Family Historian: V7
- Location: Washington State, USA
Re: Relationships
Go to Tools > Preferences and select Property Box and then Captions and add this to the first box:
[=Relationship(FileRoot(),,TEXT,1)]
Bill
[=Relationship(FileRoot(),,TEXT,1)]
Bill
Re: Relationships
Brilliant thank you Bill
- fhtess65
- Megastar
- Posts: 525
- Joined: 15 Feb 2018 21:34
- Family Historian: V7
- Location: British Columbia, Canada
- Contact:
Re: Relationships
That works a treat!!!
---
Teresa Basińska Eckford
Librarian & family historian
http://writingmypast.wordpress.com
Researching: Spong, Ferdinando, Taylor, Lawley, Sinkins, Montgomery; Basiński, Hilferding, Ratowski, Paszkiewicz
Teresa Basińska Eckford
Librarian & family historian
http://writingmypast.wordpress.com
Researching: Spong, Ferdinando, Taylor, Lawley, Sinkins, Montgomery; Basiński, Hilferding, Ratowski, Paszkiewicz
Re: Relationships
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?
- BillH
- Megastar
- Posts: 2179
- Joined: 31 May 2010 03:40
- Family Historian: V7
- Location: Washington State, USA
Re: Relationships
The different parts are defined in the Help under the Relationship function.
https://www.family-historian.co.uk/help ... nship.html
https://www.family-historian.co.uk/help ... nship.html
- Jane
- Site Admin
- Posts: 8440
- Joined: 01 Nov 2002 15:00
- Family Historian: V7
- Location: Somerset, England
- Contact:
Re: Relationships
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."
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."
Re: Relationships
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?BillH wrote: ↑22 Jul 2023 17:02The different parts are defined in the Help under the Relationship function.
https://www.family-historian.co.uk/help ... nship.html
Also, if the function requires 4 parameters, why does the simpler =Relationship(FileRoot()) apparently work OK?
Re: Relationships
Thanks, Jane - I thought there might be a way, but it would have taken me a while to find it by myself.Jane wrote: ↑22 Jul 2023 17:24To 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))
- BillH
- Megastar
- Posts: 2179
- Joined: 31 May 2010 03:40
- Family Historian: V7
- Location: Washington State, USA
Re: Relationships
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.
I guess if you don't specify all 4 parameters, then it uses some defaults. I'm not really sure.Also, if the function requires 4 parameters, why does the simpler =Relationship(FileRoot()) apparently work OK?
Bill
Re: Relationships
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.
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.
- tatewise
- Megastar
- Posts: 27074
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Relationships
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.
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
- BillH
- Megastar
- Posts: 2179
- Joined: 31 May 2010 03:40
- Family Historian: V7
- Location: Washington State, USA
Re: Relationships
Mike,
If you want to find the relationship between two individuals, how do you code the individuals in the function?
Thanks,
Bill
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
Reason: Corrected the 2nd/3rd 3rd/4th parameter wording
- Jane
- Site Admin
- Posts: 8440
- Joined: 01 Nov 2002 15:00
- Family Historian: V7
- Location: Somerset, England
- Contact:
Re: Relationships
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.
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."
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."
Re: Relationships
Thanks for the explanations - I can see what's going on better now.
- tatewise
- Megastar
- Posts: 27074
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Relationships
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.
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
- BillH
- Megastar
- Posts: 2179
- Joined: 31 May 2010 03:40
- Family Historian: V7
- Location: Washington State, USA
Re: Relationships
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
Re: Relationships
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:
As an example, my great grandfather's caption shows his Name, Nickname, Relationship to me, and his Custom ID:
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.
Many thanks to all those who have helped me with this.
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]%,")",)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.
Many thanks to all those who have helped me with this.
- tatewise
- Megastar
- Posts: 27074
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Relationships
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
- BillH
- Megastar
- Posts: 2179
- Joined: 31 May 2010 03:40
- Family Historian: V7
- Location: Washington State, USA
Re: Relationships
Mike,
Thanks.
Bill
Thanks.
Bill
Re: Relationships
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):
where personid is their number, eg:
Thank you tatewise for the clue.
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)]Code: Select all
[=Relationship(Record(390,"I"),,TEXT,1)]- BillH
- Megastar
- Posts: 2179
- Joined: 31 May 2010 03:40
- Family Historian: V7
- Location: Washington State, USA
Re: Relationships
Thanks ississi, I'll give it a try.
Bill
Bill
Re: Relationships
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!
Researching:
Waycott, Fewings, Piper, Burgoyne, Johns, Phillips, Paddon, Streat;
Morrish, Rowd*n, Pike, Lowder, Flood, Parsons and others.
All in glorious Devon!
Re: Relationships
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?
Re: Relationships
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:
where record ID 2 represents my father.
The only problem is that now my husband's entire line is marked as "Maternal"
I echo Arthur's sentiment that someone probably has a more sophisticated solution!
Code: Select all
=TextIf(DnaBloodRelation(Record(2),%INDI%), "Paternal", "Maternal")The only problem is that now my husband's entire line is marked as "Maternal"
I echo Arthur's sentiment that someone probably has a more sophisticated solution!
Sarah Bell – Australia
View my tree on Wikitree
View my tree on Wikitree