* Last Married Name

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
Gary Carson
Famous
Posts: 162
Joined: 02 Mar 2016 17:46
Family Historian: V7
Location: Grand Island, Nebraska, USA

Last Married Name

Post by Gary Carson » 19 Mar 2022 18:06

Am trying to create a last married name for females only in a Result Set column in various queries.

=TextIf((%INDI.SEX%=Female)(Exists(%INDI.FAMS[last]>HUSB>%),%INDI.FAMS[last]>HUSB>NAME:SURNAME%,%INDI.NAME:SURNAME%)

The above expression is not valid. How do I correct. I want result for only females exclusive of males.
Gary
Win 10, FH 7.0.15

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

Re: Last Married Name

Post by tatewise » 19 Mar 2022 19:28

You need to turn the condition parameter into a valid boolean expression:

=TextIf( IsTrue( ( %INDI.SEX% = "Female" ) and Exists( %INDI.FAMS[last]>HUSB>% ) ), %INDI.FAMS[last]>HUSB>NAME:SURNAME% ,%INDI.NAME:SURNAME% )
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
Gary Carson
Famous
Posts: 162
Joined: 02 Mar 2016 17:46
Family Historian: V7
Location: Grand Island, Nebraska, USA

Re: Last Married Name

Post by Gary Carson » 19 Mar 2022 19:45

When I insert expression you corrected for me, males are also listed with surname.
Gary
Win 10, FH 7.0.15

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

Re: Last Married Name

Post by tatewise » 19 Mar 2022 21:05

Yes, well that is what the expression does.
If the person is female and has a husband, it shows the last husband's surname, otherwise (for males and unmaried women) it shows the person's surname.
You need nested TextIf if you want to exclude males altogether.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
Gary Carson
Famous
Posts: 162
Joined: 02 Mar 2016 17:46
Family Historian: V7
Location: Grand Island, Nebraska, USA

Re: Last Married Name

Post by Gary Carson » 20 Mar 2022 00:34

I am having trouble to nest expression to achieve desired result. Help/hint please.
Gary
Win 10, FH 7.0.15

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

Re: Last Married Name

Post by tatewise » 20 Mar 2022 10:48

The nesting approach needs to replace %INDI.NAME:SURNAME% with a TextIf(...) function such as:
TextIf( %INDI.SEX% = "Female", %INDI.NAME:SURNAME%, "" )

Tip: Ensure the ( parentheses ) are correctly nested by counting them in pairs.

However, in this case, there is another solution using the =Sex(...) and =CombineText(...) functions:
=Sex( %INDI%, "", CombineText( "", %INDI.FAMS[last]>HUSB>NAME:SURNAME%, "", %INDI.NAME:SURNAME% ), "")
i.e.
=Sex( %INDI%, <male name blank>, <female name expression>, <unknown sex blank> )

<female name expression> = CombineText( "", %INDI.FAMS[last]>HUSB>NAME:SURNAME%, "", %INDI.NAME:SURNAME% )
i.e.
CombineText( <blank prefix>, <last husband surname>, <blank suffix>, <maiden name when no husband> )
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
Gary Carson
Famous
Posts: 162
Joined: 02 Mar 2016 17:46
Family Historian: V7
Location: Grand Island, Nebraska, USA

Re: Last Married Name

Post by Gary Carson » 20 Mar 2022 15:50

Great help. Thanks
Gary
Win 10, FH 7.0.15

Post Reply