* Help with expressions

Homeless Posts from the old forum system
Locked
User avatar
johnmorrisoniom
Megastar
Posts: 882
Joined: 18 Dec 2008 07:40
Family Historian: V7
Location: Isle of Man

Help with expressions

Post by johnmorrisoniom » 02 May 2012 14:13

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

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

Help with expressions

Post by tatewise » 02 May 2012 14:57

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.

User avatar
johnmorrisoniom
Megastar
Posts: 882
Joined: 18 Dec 2008 07:40
Family Historian: V7
Location: Isle of Man

Help with expressions

Post by johnmorrisoniom » 02 May 2012 16:23

Thanks very much Mike,

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

Locked