* Last Married Name
- Gary Carson
- Famous
- Posts: 162
- Joined: 02 Mar 2016 17:46
- Family Historian: V7
- Location: Grand Island, Nebraska, USA
Last Married Name
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.
=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
Win 10, FH 7.0.15
- tatewise
- Megastar
- Posts: 27088
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Last Married Name
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% )
=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
- Gary Carson
- Famous
- Posts: 162
- Joined: 02 Mar 2016 17:46
- Family Historian: V7
- Location: Grand Island, Nebraska, USA
Re: Last Married Name
When I insert expression you corrected for me, males are also listed with surname.
Gary
Win 10, FH 7.0.15
Win 10, FH 7.0.15
- tatewise
- Megastar
- Posts: 27088
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Last Married Name
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.
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
- Gary Carson
- Famous
- Posts: 162
- Joined: 02 Mar 2016 17:46
- Family Historian: V7
- Location: Grand Island, Nebraska, USA
Re: Last Married Name
I am having trouble to nest expression to achieve desired result. Help/hint please.
Gary
Win 10, FH 7.0.15
Win 10, FH 7.0.15
- tatewise
- Megastar
- Posts: 27088
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Last Married Name
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> )
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
- Gary Carson
- Famous
- Posts: 162
- Joined: 02 Mar 2016 17:46
- Family Historian: V7
- Location: Grand Island, Nebraska, USA