* Fact based query problem
-
GordonH
- Diamond
- Posts: 84
- Joined: 27 Jan 2010 13:12
- Family Historian: V6
- Location: Contin, Scotland
- Contact:
Fact based query problem
I have made a custom query to list all occupations recorded in the family history, the name of the individual employed in that occupation, the date and place of employment, and their age. To create this I copied the 'All Facts' query and customized it to list only occupation facts. All is working fine apart from one column, the age column which appears blank on every entry.
I could understand that to be the case were there no date of birth for the individuals concerned. However, this is not the case, ages are listed in the properties tab for each occupation for the individuals concerned and I am at a loss to understand what the problem is.
I have given some technical details of the query below in the hope that someone can throw some light upon this.
Query Type; Fact
Column 1; Occupation =FactValue(%FACT%) Ascending Sort
Column 2; Date %FACT.DATE:COMPACT% Ascending Sort
Column 3; Age %FACT.AGE% Sort None
Column 4; Name =FactOwner(%FACT%,1,MALES_FIRST) Sort None
Column 5; Place %FACT.PLAC% Sort None
The 'Hidden' box is unchecked on all of the above.
There is only one row condition as follows;
Add if =FactLabel(%Fact%)matches 'Occupation'
ID:6795
I could understand that to be the case were there no date of birth for the individuals concerned. However, this is not the case, ages are listed in the properties tab for each occupation for the individuals concerned and I am at a loss to understand what the problem is.
I have given some technical details of the query below in the hope that someone can throw some light upon this.
Query Type; Fact
Column 1; Occupation =FactValue(%FACT%) Ascending Sort
Column 2; Date %FACT.DATE:COMPACT% Ascending Sort
Column 3; Age %FACT.AGE% Sort None
Column 4; Name =FactOwner(%FACT%,1,MALES_FIRST) Sort None
Column 5; Place %FACT.PLAC% Sort None
The 'Hidden' box is unchecked on all of the above.
There is only one row condition as follows;
Add if =FactLabel(%Fact%)matches 'Occupation'
ID:6795
-
delwoodman
- Famous
- Posts: 125
- Joined: 15 Sep 2007 10:42
- Family Historian: V6.2
- Location: Brighton, East Sussex, UK
Fact based query problem
I believe the item %FACT.AGE% is an age entered in the property box rather than a calculated age - so if you haven't entered the age for the fact concerned, the field will be null.
Derek
Derek
- BillH
- Megastar
- Posts: 2183
- Joined: 31 May 2010 03:40
- Family Historian: V7
- Location: Washington State, USA
Fact based query problem
Hi Gordon,
I'm not sure, but try %INDI.OCCU[1].DATE:AGE_AT% instead. I think this will give the calculated age.
Bill
I'm not sure, but try %INDI.OCCU[1].DATE:AGE_AT% instead. I think this will give the calculated age.
Bill
- Jane
- Site Admin
- Posts: 8441
- Joined: 01 Nov 2002 15:00
- Family Historian: V7
- Location: Somerset, England
- Contact:
Fact based query problem
You have used the Recorded Age not a computed one so you will only see it if you have typed it in.
If you want FH to compute the date, use the AgeAt function with the occupation date.
=AgeAt(FactOwner(%FACT%,1,MALES_FIRST),%FACT.DATE%)
Bill: Fact Queries won't allow you to use INDI, hence the FactOwner function.
If you want FH to compute the date, use the AgeAt function with the occupation date.
=AgeAt(FactOwner(%FACT%,1,MALES_FIRST),%FACT.DATE%)
Bill: Fact Queries won't allow you to use INDI, hence the FactOwner function.
- tatewise
- Megastar
- Posts: 27082
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Fact based query problem
But the DATE:AGE_AT qualifier should work OK.
-
GordonH
- Diamond
- Posts: 84
- Joined: 27 Jan 2010 13:12
- Family Historian: V6
- Location: Contin, Scotland
- Contact:
Fact based query problem
Many thanks to all for the quick responses. I apologise for the delay in replying but my internet connection died after I posted my question.
I was not aware that the expression I used (created by FH after clicking 'Age' in the list of fields then '>') was linked to the age field on the property box.
The solution Jane posted worked perfectly but the %INDI.OCCU[1].DATE:AGE_AT% expression gave rise to the following error; Invalid data reference for the current query type.
With regard to the age being entered on the property box. I have never used that field and am curious about why it should ever be used.
If the birth date is known (even approximately) why would an age be entered when FH can be left to calculate it? Also, if the birth date is not known then how could an age be entered anyway?
I was not aware that the expression I used (created by FH after clicking 'Age' in the list of fields then '>') was linked to the age field on the property box.
The solution Jane posted worked perfectly but the %INDI.OCCU[1].DATE:AGE_AT% expression gave rise to the following error; Invalid data reference for the current query type.
With regard to the age being entered on the property box. I have never used that field and am curious about why it should ever be used.
If the birth date is known (even approximately) why would an age be entered when FH can be left to calculate it? Also, if the birth date is not known then how could an age be entered anyway?
- PeterR
- Megastar
- Posts: 1129
- Joined: 10 Jul 2006 16:55
- Family Historian: V7
- Location: Northumberland, UK
Fact based query problem
Some documents, e.g. marriage certificate, give a person's occupation and age, but not their date of birth.GordonH said:
Also, if the birth date is not known then how could an age be entered anyway?
-
GordonH
- Diamond
- Posts: 84
- Joined: 27 Jan 2010 13:12
- Family Historian: V6
- Location: Contin, Scotland
- Contact:
Fact based query problem
I see. However, if an age is given on a document I use that to enter an estimated/approximate date of birth. I feel this has the advantage of enabling a calculated age for all other facts.
The only drawback I see with that is that ages are sometimes incorrect on documents, that other documents for the same person may give ages that lead to different estimates for their year of birth. In such cases I have to make a judgement as to what I feel is right then add a note to the birth event explaining my decision.
If there are disadvantages to this way of working that I've not foreseen I'd be grateful for advice.
The only drawback I see with that is that ages are sometimes incorrect on documents, that other documents for the same person may give ages that lead to different estimates for their year of birth. In such cases I have to make a judgement as to what I feel is right then add a note to the birth event explaining my decision.
If there are disadvantages to this way of working that I've not foreseen I'd be grateful for advice.
- tatewise
- Megastar
- Posts: 27082
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Fact based query problem
Since it is a Fact Query the expression would have to be %FACT.DATE:AGE_AT% from Columns tab Fields pane on left Fact + Date although :AGE_AT qualifier is missing and must be added by hand!
Some users like to record the DoB given in Birth documents, and also record the Age given on other documents.
In early records it may never be possible to obtain the exact DoB.
Documents do not always report the facts accurately, so it is handy to have the details in the Property Box.
Some users like to record the DoB given in Birth documents, and also record the Age given on other documents.
In early records it may never be possible to obtain the exact DoB.
Documents do not always report the facts accurately, so it is handy to have the details in the Property Box.
- BillH
- Megastar
- Posts: 2183
- Joined: 31 May 2010 03:40
- Family Historian: V7
- Location: Washington State, USA
Fact based query problem
Sorry Gordon, I think I gave you what you would need in an individual query, not a fact query. I see Mike gave you the correct version.
Bill
Bill
-
GordonH
- Diamond
- Posts: 84
- Joined: 27 Jan 2010 13:12
- Family Historian: V6
- Location: Contin, Scotland
- Contact:
Fact based query problem
Thanks Bill, it's no problem! This has been an educational thread for me and I plan to try and improve my understanding of expressions and functions as a result.
Mike and PeterR, many thanks for your thoughts on the use of the Properties Tab 'Age' box. I'm now thinking about how I can use it in addition to my current way of working.
Mike and PeterR, many thanks for your thoughts on the use of the Properties Tab 'Age' box. I'm now thinking about how I can use it in addition to my current way of working.
- LornaCraig
- Megastar
- Posts: 2996
- Joined: 11 Jan 2005 17:36
- Family Historian: V7
- Location: Oxfordshire, UK
Fact based query problem
If an age is entered in FH as recorded in a document and the age is not compatible with the 'known' date of birth FH puts an exclamation mark after it in the Property box. Looking at the column of exclamation marks can be both useful and interesting:If the birth date is known (even approximately) why would an age be entered when FH can be left to calculate it?
If the only incorrect age is the age at marriage it may mean that an individual was lying about their age in order not to have to get parental consent. (I have a few cases like that!) If age in censuses is correct until early adulthood and then starts to be understated it may mean someone is trying to conceal their true age (usually unmarried women, I'm afraid to say).
More usefully, if age in censuses is consistently wrong, for example consistently 3 years younger that expected, it can draw attention to the fact that this is not the person you think it is. Fairly recently I found a case where someone with the right name was with the right family but their age was consistenly wrong. It turned out that the first child of that name in the family had died and a later child had been given the same name. I would not have noticed this if not for the exclamation marks in the Property box.