Page 1 of 1

Help with expressions

Posted: 02 May 2012 14:13
by johnmorrisoniom
I'm trying to tweak a downloaded custom query that shows whether a census event, source and or image are present.

I have successfully changed the ancestor for descendent.

I would like to show 'BB' or 'AD' for each year that is before birth or after death.

At present the following line gives a Y if an event is there

Code: Select all

=Exists(%INDI.CENS[year=1841].PLAC%)
Is it possible to tweak this as a three way IF?

An expression builder would be a very useful tool for the query window (One for the wishlist)

Any help greatly appreciated

John

ID:6205

Help with expressions

Posted: 02 May 2012 14:57
by tatewise
Try this

=TextIf(%INDI.BIRT.DATE% > DateAt(1841,6,6), 'BB', TextIf( %INDI.DEAT.DATE% < DateAt(1841,6,6), 'AD', Exists(%INDI.CENS[year=1841].PLAC%) ) )

This is very precise about the Census DateAt and returns either BB or AD or Y or blank (if no Census Event).

It is easily adapted for any Census Year.

Help with expressions

Posted: 02 May 2012 16:23
by johnmorrisoniom
Thanks very much Mike,

I knew roughly what was needed, but couldn't get my head round it.