* Query Data Missing

News and Announcements from the Family Historian World
Post Reply
avatar
admin
Famous
Posts: 245
Joined: 30 Aug 2013 07:52
Family Historian: V6
Contact:

Query Data Missing

Post by admin »

Query Data Missing
Date: Fri, 6 Sep 2002 11:07:20 +0100
Dave Pacey wrote:
>> I have now entered 44 Events for the 1901 census, and only 22 of them show up in a query based on CENS_DATE
Dave used the following filter to find Individual records which have a 1901 census entry:
Add if %INDI.CENS.DATE% contains text ['Which Year?'].
If you click on this filter and look at the expression in the field at the bottom of the filter window, you will see that the expression is shown as %INDI.CENS[1].DATE%. This is because if you don't specify the instance for a given tag, Family Historian assumes you want the first instance. And this is why the query doesn't give you what you want, Dave. It is looking for Individual records where the FIRST census entry only contains the year you specify. But what you're after is an individual record where ANY census record contains the year you specify.
To get the result you want, you need to decide what the maximum no. of census entries anyone could have (let's assume that this is 6), and change your filter list to specify all of them: e.g.
Add if %INDI.CENS.DATE% contains text ['Which Year?']. Add if %INDI.CENS[2].DATE% contains text ['Which Year?']. Add if %INDI.CENS[3].DATE% contains text ['Which Year?']. Add if %INDI.CENS[4].DATE% contains text ['Which Year?']. Add if %INDI.CENS[5].DATE% contains text ['Which Year?']. Add if %INDI.CENS[6].DATE% contains text ['Which Year?'].
Its very important that you use exactly the same parameter label (in this case 'Which Year?') each time, so that you only have to type in the year once, when you run the query.
Incidentally, its quite easy add the same filter 6 times. You select the first filter, change the expression to show the right instance value, and then click 'Add'. Change the instance value again and click 'Add' again. You don't have to retype any of the other details.
Although this works, it is not very elegant. I have added the following to the Wish List: you should be able to specify a 'wildcard' instance so that you can check ALL occurrences of census entries in one line (alternatively, perhaps, if you don't specify an instance value, this is interpreted as 'any instance' - at least in filter expressions).
Incidentally, don't assume that census entries (or any other event entries) are in date order. e.g. if a person has a census entry for the 1881 census and one for the 1901 census, they are not necessarily stored in that order. The 'first instance' means the first, as ordered within the record - not the first in date order. There is already a wish-list item relating to storing of events in date order, but at present you have to order them manually yourself if you want them to be kept in date order (the order that you see events in the Events tab of the Property Dialog is different - by default they are displayed here in date order, but you choose other orders to display them in, by clicking on any of the column headings).
Simon Orde List Administrator and Family Historian designer
Post Reply