* Stacked Conditional Operators?

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
stewartrb
Diamond
Posts: 79
Joined: 21 Jun 2012 16:12
Family Historian: V7
Location: Chesapeake, VA

Stacked Conditional Operators?

Post by stewartrb » 15 Sep 2017 19:31

What I had:
=ExistsText(%INDI.DEAT[1+]%,"✝") %INDI.DEAT[1+].DATE:COMPACT% in %INDI.DEAT[1+].PLAC:TIDY%

But I want it nuanced:
=TextIf(%INDI.DEAT[1+]%, TextIf(HasFlag(%INDI%, "KIA"), "⚔", "✝")) %INDI.DEAT[1+].DATE:COMPACT% in %INDI.DEAT[1+].PLAC:TIDY%

(Which doesn't work.)

Basically, I want the ✝ if I have death info, but I want to change it to ⚔ if the individual is flagged as killed in battle.
Last edited by stewartrb on 15 Sep 2017 20:48, edited 1 time in total.

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

Re: Stacked Conditional Operators?

Post by tatewise » 15 Sep 2017 19:57

You are nearly there Stewart.
The =TextIf(...) needs its first parameter to be boolean (true/false), so use Exists(%INDI.DEAT[1+]%)
e.g.
=TextIf( Exists(%INDI.DEAT[1+]%), TextIf( HasFlag(%INDI%,"KIA"), "⚔", "✝" ) , )
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
stewartrb
Diamond
Posts: 79
Joined: 21 Jun 2012 16:12
Family Historian: V7
Location: Chesapeake, VA

Re: Stacked Conditional Operators?

Post by stewartrb » 15 Sep 2017 20:51

They do stack.

Thanks.

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

Re: Stacked Conditional Operators?

Post by tatewise » 16 Sep 2017 08:45

You could also persevere with your original simpler expression:

=ExistsText( %INDI.DEAT[1+]%, TextIf( HasFlag(%INDI%,"KIA"), "⚔", "✝" ) )

BTW: If you don't record multiple Death Events the [1+] looping index is not needed, so just use:
=ExistsText( %INDI.DEAT%, TextIf( HasFlag(%INDI%,"KIA"), "⚔", "✝" ) ) %INDI.DEAT.DATE:COMPACT% in %INDI.DEAT.PLAC:TIDY% which defaults to INDI.DEAT[1] throughout.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

Post Reply