* Help with formulae in custom queries

Questions regarding use of any Version of Family Historian. Please ensure you have set your Version of Family Historian in your Profile
Post Reply
avatar
maxwelledgar
Newbie
Posts: 2
Joined: 28 Mar 2017 14:25
Family Historian: V6.2

Help with formulae in custom queries

Post by maxwelledgar » 25 Aug 2019 16:08

Could anyone please help me. I have set up a custom query based on the standard relation queries. I have a column for date of birth and a column indicating whether the individual has a living flag with expressions %INDI.BIRT[1].DATE:COMPACT% and %INDI._FLGS.__LIVING% respectively. I have no experience of using formulae or computer programming. Could a formula be written to replace the date of birth expression so that in the column the date of birth was replaced with the word “living” when there is a living flag attached to the record but remained as the date of birth otherwise. Thanks.

User avatar
tatewise
Megastar
Posts: 16319
Joined: 25 May 2010 11:00
Family Historian: V6.2
Location: Torbay, Devon, UK
Contact:

Re: Help with formulae in custom queries

Post by tatewise » 25 Aug 2019 17:01

Try the following conditional text function:

=TextIf( Exists(%INDI._FLGS.__LIVING%), "Living", %INDI.BIRT.DATE:COMPACT% )

Where if the Living Flag exists then show "Living" else show Date of Birth.

An alternative is:

=TextIf( Exists(%INDI._FLGS.__LIVING%), "Living", EstimatedBirthDate(%INDI%,MID,2) )

It is similar, and shows Date of Birth if it exists, but if not it shows Baptism/Christening Date, or an estimated date based on the BMD dates of relatives.

See Knowledge Base > Understanding Functions that explains more about functions and where to find the Help in FH.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

avatar
maxwelledgar
Newbie
Posts: 2
Joined: 28 Mar 2017 14:25
Family Historian: V6.2

Re: Help with formulae in custom queries

Post by maxwelledgar » 25 Aug 2019 19:53

Thanks Mike, that is exactly what I wanted. I had looked at the knowledge base but to me it was like reading a foreign language.

User avatar
tatewise
Megastar
Posts: 16319
Joined: 25 May 2010 11:00
Family Historian: V6.2
Location: Torbay, Devon, UK
Contact:

Re: Help with formulae in custom queries

Post by tatewise » 25 Aug 2019 20:02

Well yes, it is a 'foreign' language, until you get used to it, just like any foreign language you need to devote some time & effort and practice it.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

Post Reply