* How to set a flag based upon age at death?
How to set a flag based upon age at death?
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
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
- 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?
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 )
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 )
How to set a flag based upon age at death?
That works really nicely Tatewise - and more than, that, I can see how it works!
Thanks very much - off to play some more!
Thanks very much - off to play some more!
- 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?
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.
=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.
How to set a flag based upon age at death?
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.
=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.
- 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?
I use several expressions in diagrams to show an appropriate icon.
One of the expressions is:
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.
One of the expressions is:
Code: Select all
=IsTrue((AgeAt(%INDI%,%INDI.DEAT.DATE%) <= 5) and (AgeAt(%INDI%,%INDI.DEAT.DATE%) >= 1))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.
How to set a flag based upon age at death?
John - that's an interesting idea which I'll give some thought to!
- 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?
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.
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.
Re: How to set a flag based upon age at death?
Thank you for this. I used it to colour the text of those who died young.