There is a custom query to show the age at the birth of the first child of a parent. Query:Individual ~ Age at Birth of First Child
How do I adapt it to show the age at the birth of the last child of a family?
Thanks.
Graham
* Query: Age at birth of last child
- tatewise
- Megastar
- Posts: 27079
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Query: Age at birth of last child
The answer is a bit complicated where multiple marriages/partnerships are involved.
So let's deal with the simple case of only one marriage/partnership per person.
On the Columns tab you need to use the following Expressions using the the [last] index:
=AgeAt(%INDI%,%INDI.FAMS[1]>CHIL[last]>BIRT.DATE%)
%INDI.FAMS[1]>CHIL[last]>%
%INDI.FAMS[1]>CHIL[last]>BIRT[1].DATE%
and on the Rows filter tab:
%INDI.FAMS[1]>CHIL[last]>BIRT[1].DATE%
But notice they all refer to INDI.FAMS[1] i.e. the 1st Spouse Family
So if the person had mutiple marriages/partnerships there will be INDI.FAMS[2] and maybe INDI.FAMS[3], etc.
But if you use INDI.FAMS[last] that marriage/partnership may not have any children, but earlier ones might.
However, there is a shortcut that yields the last child from any of the marriages/partnerships.
Replace each FAMS[1]>CHIL[last] with ~CHIL[last] so the first Expression above becomes:
=AgeAt(%INDI%,%INDI.~CHIL[last]>BIRT.DATE%)
In fact the original Query should have used ~CHIL[1] to get 1st child from any marriages/partnerships.
If you want the last child from each separate marriage/partnership then that will need a radically different method.
So let's deal with the simple case of only one marriage/partnership per person.
On the Columns tab you need to use the following Expressions using the the [last] index:
=AgeAt(%INDI%,%INDI.FAMS[1]>CHIL[last]>BIRT.DATE%)
%INDI.FAMS[1]>CHIL[last]>%
%INDI.FAMS[1]>CHIL[last]>BIRT[1].DATE%
and on the Rows filter tab:
%INDI.FAMS[1]>CHIL[last]>BIRT[1].DATE%
But notice they all refer to INDI.FAMS[1] i.e. the 1st Spouse Family
So if the person had mutiple marriages/partnerships there will be INDI.FAMS[2] and maybe INDI.FAMS[3], etc.
But if you use INDI.FAMS[last] that marriage/partnership may not have any children, but earlier ones might.
However, there is a shortcut that yields the last child from any of the marriages/partnerships.
Replace each FAMS[1]>CHIL[last] with ~CHIL[last] so the first Expression above becomes:
=AgeAt(%INDI%,%INDI.~CHIL[last]>BIRT.DATE%)
In fact the original Query should have used ~CHIL[1] to get 1st child from any marriages/partnerships.
If you want the last child from each separate marriage/partnership then that will need a radically different method.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
Re: Query: Age at birth of last child
Thanks, Mike.
I wanted to get a histogram from my data to give me the profile of age at the birth of the last child. It just might help me clarify the probable mother of a child with no recorded birth event.
I wanted to get a histogram from my data to give me the profile of age at the birth of the last child. It just might help me clarify the probable mother of a child with no recorded birth event.
- tatewise
- Megastar
- Posts: 27079
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Query: Age at birth of last child
So you need to add a Rows filter to exclude males as only the data for women is relevant.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
Re: Query: Age at birth of last child
Here is the finished product.