Page 1 of 1
Fact based query problem
Posted: 28 Feb 2013 18:29
by GordonH
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
Fact based query problem
Posted: 28 Feb 2013 20:55
by delwoodman
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
Fact based query problem
Posted: 28 Feb 2013 20:58
by BillH
Hi Gordon,
I'm not sure, but try %INDI.OCCU[1].DATE:AGE_AT% instead. I think this will give the calculated age.
Bill
Fact based query problem
Posted: 28 Feb 2013 21:00
by Jane
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.
Fact based query problem
Posted: 28 Feb 2013 21:47
by tatewise
But the DATE:AGE_AT qualifier should work OK.
Fact based query problem
Posted: 01 Mar 2013 09:14
by GordonH
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?
Fact based query problem
Posted: 01 Mar 2013 11:44
by PeterR
GordonH said:
Also, if the birth date is not known then how could an age be entered anyway?
Some documents, e.g. marriage certificate, give a person's occupation and age, but not their date of birth.
Fact based query problem
Posted: 01 Mar 2013 11:59
by GordonH
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.
Fact based query problem
Posted: 01 Mar 2013 15:10
by tatewise
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.
Fact based query problem
Posted: 01 Mar 2013 17:10
by BillH
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
Fact based query problem
Posted: 01 Mar 2013 17:35
by GordonH
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.
Fact based query problem
Posted: 01 Mar 2013 17:45
by LornaCraig
If the birth date is known (even approximately) why would an age be entered when FH can be left to calculate it?
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 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.