Page 1 of 1

Help with formulae in custom queries

Posted: 25 Aug 2019 16:08
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.

Re: Help with formulae in custom queries

Posted: 25 Aug 2019 17:01
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.

Re: Help with formulae in custom queries

Posted: 25 Aug 2019 19:53
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.

Re: Help with formulae in custom queries

Posted: 25 Aug 2019 20:02
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.