* Expression - is it possible to get son of / daughter of

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
User avatar
dewilkinson
Superstar
Posts: 280
Joined: 04 Nov 2016 19:05
Family Historian: V7
Location: Oundle, Northamptonshire, England
Contact:

Expression - is it possible to get son of / daughter of

Post by dewilkinson » 23 Nov 2016 08:24

In a sentence I am able to produce "...of John Starling Butcher and Eleanor Durrell Norman" with the expression {%CUR_PRIN.FAMC[1]>%} , but I cannot seem to find how to get son of... / daughter of ..... Is that possible?
David Wilkinson researching Bowtle, Butcher, Edwards, Gillingham, Overett, Ransome, Simpson, and Wilkinson in East Anglia

Deterioration is contagious, and places are destroyed or renovated by the spirit of the people who go to them

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

Re: Expression - is it possible to get son of / daughter of

Post by tatewise » 23 Nov 2016 11:03

Use {=CombineText( Sex(%CUR_PRIN%," son"," daughter"," ?"), %CUR_PRIN.FAMC>%, "")}

This only produces text if %CUR_PRIN.FAMC>% exists, i.e. there are parents.
The 1st parameter is a prefix and the 3rd parameter is a suffix (in case blank).
The prefix Sex(%CUR_PRIN%," son"," daughter"," ?") produces text according to Sex of Individual.

That will produce son...of John Starling Butcher and Eleanor Durrell Norman etc.

But I suspect you will want to get rid of the elipsis (...)?
So you will need:
{=CombineText(Sex(%CUR_PRIN%," son of "," daughter of "," ? of "), TextIf( Exists(%CUR_PRIN.FAMC%), Text( CombineText(,%CUR_PRIN.~FATH>%,,"unknown father") . " and " . CombineText(,%CUR_PRIN.~MOTH>%,,"unknown mother")),""),"",)}
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
dewilkinson
Superstar
Posts: 280
Joined: 04 Nov 2016 19:05
Family Historian: V7
Location: Oundle, Northamptonshire, England
Contact:

Re: Expression - is it possible to get son of / daughter of

Post by dewilkinson » 23 Nov 2016 13:27

Mike,

Thank you, that works a treat. My next hurdle is to do the same in a marriage sentence and pick up the spouses parents, is that possible?
David Wilkinson researching Bowtle, Butcher, Edwards, Gillingham, Overett, Ransome, Simpson, and Wilkinson in East Anglia

Deterioration is contagious, and places are destroyed or renovated by the spirit of the people who go to them

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

Re: Expression - is it possible to get son of / daughter of

Post by tatewise » 23 Nov 2016 14:03

Yes, the expression is exactly the same for the husband, and for the wife simply replace each CUR_PRIN with CUR_PRIN2.
i.e. Current Principal and Current Principal 2

Keep the Sex(...) functions to cater for same sex partnerships.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
dewilkinson
Superstar
Posts: 280
Joined: 04 Nov 2016 19:05
Family Historian: V7
Location: Oundle, Northamptonshire, England
Contact:

Re: Expression - is it possible to get son of / daughter of

Post by dewilkinson » 23 Nov 2016 14:51

Mike,

I did wonder if it was as simple as that.

Thank you very much for your help, I can begin to see how expressions work now.
David Wilkinson researching Bowtle, Butcher, Edwards, Gillingham, Overett, Ransome, Simpson, and Wilkinson in East Anglia

Deterioration is contagious, and places are destroyed or renovated by the spirit of the people who go to them

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

Re: Expression - is it possible to get son of / daughter of

Post by tatewise » 23 Nov 2016 15:36

Now you are getting to understand them, did you find how_to:understanding_expressions|> Understanding Expressions a useful starting point, bearing in mind its cross-references to the FH Help on Advanced Topics and to Data References and Functions?

Are there ways it could be improved?

Remember, it appears you have only been using FH for less than a month ! ! !
At this rate you will soon be an expert. :D
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
dewilkinson
Superstar
Posts: 280
Joined: 04 Nov 2016 19:05
Family Historian: V7
Location: Oundle, Northamptonshire, England
Contact:

Re: Expression - is it possible to get son of / daughter of

Post by dewilkinson » 23 Nov 2016 16:23

Mike,

I wouldn't quite say that, but I have many years of programming experience in many languages and in database design and management.

I did look at Expressions in the Knowledge Base and have set up a few already. I thought this more difficult expression must be possible, and had a go, but the difficulty with all things like this is understanding the protocols and syntax. I didn't think Prin2 would apply in both directions in a marriage, but it does. This tells me this expression system is incredibly powerful and seemingly little is impossible. it is just knowing how.

I really look forward to exploring this aspect further and making use of the capabilities. Coming from TMG this capability makes a huge advance.
David Wilkinson researching Bowtle, Butcher, Edwards, Gillingham, Overett, Ransome, Simpson, and Wilkinson in East Anglia

Deterioration is contagious, and places are destroyed or renovated by the spirit of the people who go to them

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

Re: Expression - is it possible to get son of / daughter of

Post by tatewise » 29 May 2020 14:07

Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

Post Reply