* 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. If your question fits in one of these subject-specific sub-forums, please ask it there.
Post Reply
avatar
maxwelledgar
Newbie
Posts: 3
Joined: 28 Mar 2017 14:25
Family Historian: V7

Help with formulae in custom queries

Post by maxwelledgar »

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: 28344
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Help with formulae in custom queries

Post by tatewise »

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 how_to:understanding_functions|> 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: 3
Joined: 28 Mar 2017 14:25
Family Historian: V7

Re: Help with formulae in custom queries

Post by maxwelledgar »

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: 28344
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Help with formulae in custom queries

Post by tatewise »

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