* How to set a flag based upon age at death?

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
User avatar
wulliam
Famous
Posts: 149
Joined: 03 Oct 2009 10:29
Family Historian: V7
Contact:

How to set a flag based upon age at death?

Post by wulliam » 12 Mar 2013 15:03

I would like to have a way of:

1) adding a flag called, say, 'died young' to everyone in my file who died before their 14th birthday, and

2) having the same flag added automatically if appropriate whenever I enter anyone's date of death..so that I don't have to think it through each time.

I'm sure it's possible - probably easy - but I don't know how [frown]

Thanks for taking the time to read this!

ID:6830

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

How to set a flag based upon age at death?

Post by tatewise » 12 Mar 2013 15:15

It depends on how you plan to use the Flag.
But in most cases it is better to use an Expression in the scenarios where you need the information, e.g. Diagram Icon, or Records Window Column, or Query Filter.

The advantage of an Expression is that it is automatic.

See Using Flags and Icons that shows how to use automatic Expressions instead of manually added Flags.

The sort of Expression you would need is:

=IsTrue( %INDI.DEAT.DATE:AGE_AT% < 14 )

User avatar
wulliam
Famous
Posts: 149
Joined: 03 Oct 2009 10:29
Family Historian: V7
Contact:

How to set a flag based upon age at death?

Post by wulliam » 12 Mar 2013 15:32

That works really nicely Tatewise - and more than, that, I can see how it works!

Thanks very much - off to play some more!

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

How to set a flag based upon age at death?

Post by tatewise » 12 Mar 2013 15:47

A slightly more sophisticated Expression that works in more scenarios is:

=IsTrue( AgeAt(%INDI%,EstimatedDeathDate(%INDI%, EARLIEST, 2) ) < 14 )

where EARLIEST can be LATEST or MID and the 3rd numerical parameter specifies how many generations up & down to inspect when necessary to formulate the estimate.
If actual DATE or AGE is given then of course that takes precedence.
See the FH Help on Functions.

User avatar
wulliam
Famous
Posts: 149
Joined: 03 Oct 2009 10:29
Family Historian: V7
Contact:

How to set a flag based upon age at death?

Post by wulliam » 12 Mar 2013 16:07

OK, I've had a play and managed to get the following working:

=IsTrue(%INDI.BURI[1].DATE:YEAR% - %INDI.BAPM[1].DATE:YEAR% <14 or %INDI.BURI[1].DATE:YEAR% - %INDI.BIRT[1].DATE:YEAR% <14 or %INDI.DEAT[1].DATE:YEAR% - %INDI.BAPM[1].DATE:YEAR% <14 or %INDI.DEAT[1].DATE:YEAR% - %INDI.BIRT[1].DATE:YEAR% <14)

...the idea being that I sometimes know one of birth/baptism and one of death/burial. Is there a more efficient way to do what I've managed there?

...I've just seen your more sophisticated expression - thanks for that though I'm not after an estimate - I want to highlight those people who (almost) certainly never married or had children.

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

How to set a flag based upon age at death?

Post by johnmorrisoniom » 12 Mar 2013 16:17

I use several expressions in diagrams to show an appropriate icon.

One of the expressions is:

Code: Select all

=IsTrue((AgeAt(%INDI%,%INDI.DEAT.DATE%) <= 5) and (AgeAt(%INDI%,%INDI.DEAT.DATE%) >= 1))
This is for someone who died aged between 1 & 5.
I use similar expressions, just modifying the numbers to show different Icons for:
0-1
6-12
13-20
21-30
31-40
etc.... and eventually 100+

My thanks to Mike Tate for helping me get it working.

User avatar
wulliam
Famous
Posts: 149
Joined: 03 Oct 2009 10:29
Family Historian: V7
Contact:

How to set a flag based upon age at death?

Post by wulliam » 12 Mar 2013 17:56

John - that's an interesting idea which I'll give some thought to!

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

How to set a flag based upon age at death?

Post by tatewise » 12 Mar 2013 22:19

Wulliam ~ I believe the EstimatedDeathDate() function does give an accurate Date if your data has an actual Date or Age for Death or Burial Event.
If the 3rd Generations parameter is 0 then I suspect it looks no further.
Also I believe the AgeAt() function will use a Date from a Birth or Baptism or Christening Event.

Furthermore, by comparing EARLIEST with LATEST versions you can determine the accuracy.

Checkout the Help on Functions and perform a few experiments, perhaps on the Family Historian Sample Project before discounting the AgeAt( %INDI%, EstimatedDeathDate( %INDI%, ... ) ) option.

Maybe =IsTrue( AgeAt(%INDI%,EstimatedDeathDate(%INDI%, LATEST, 0) ) < 14 ) will do what you want.

avatar
bp158
Platinum
Posts: 38
Joined: 24 Mar 2007 16:52
Family Historian: V7
Location: Somerset

Re: How to set a flag based upon age at death?

Post by bp158 » 03 May 2016 05:03

Thank you for this. I used it to colour the text of those who died young.

Post Reply