* Conditional Text for Witnesses

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
avatar
D-W
Gold
Posts: 12
Joined: 03 Aug 2014 10:25
Family Historian: V7
Location: Devon

Conditional Text for Witnesses

Post by D-W » 20 Jul 2023 22:03

I was hoping to use {=TextIf(%FACT._SHAR[1]>SEX%= "Male", "wife", "husband")} in the following witness sentence:
'...to visit {him/her} and {his/her} {=TextIf(%FACT._SHAR[1]>SEX%= "Male","wife","husband")}' where the Witness was the person being visted to return:
'...to visit him and his wife.' if the witness was male and
'...to visit her and her husband.' if the witness was female.
However, although this works for male witnesses, it returns '...to visit her and her wife.' when the witness is female!
I would appreciate any help in getting the syntax right.

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

Re: Conditional Text for Witnesses

Post by tatewise » 21 Jul 2023 09:34

Yes, that is quite a tricky scenario.

Your problem is that FACT._SHAR[1]> refers to the 1st Fact Witness who might not be the current witness.
So use the shortcut CUR~WITN> which always refers to the current witness.
See the Help for Understanding Data References.

Better than testing the SEX field I advise using the =Sex(...) function:
{=Sex( %CUR~WITN>%, "wife", "husband", "partner")}
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

avatar
D-W
Gold
Posts: 12
Joined: 03 Aug 2014 10:25
Family Historian: V7
Location: Devon

Re: Conditional Text for Witnesses

Post by D-W » 22 Jul 2023 11:01

Thank you Mike. Once again you have come to my rescue. I found that both your proposed solutions worked.

Post Reply