* Query on Queries: Say What??

Homeless Posts from the old forum system
Locked
avatar
JKirkham
Silver
Posts: 5
Joined: 19 Aug 2009 01:01
Family Historian: None

Query on Queries: Say What??

Post by JKirkham » 27 Aug 2009 21:31

Hi Guys

I am the newby on the block and I am going to go into immediate begging mode. I have used FH for a couple of years now and have never been brave enough to play with the query mode. However recently I upgraded to V4 and promised myself that I would.

I have to say that whilst the topic is covered (in passing) with the help pages and the PDF manual I am finding the subject rather difficult to get my head around. I am one of those people who still has trouble getting my head around which is which when it come to the '> than' and '< than' signs. I constantly mix them up.

It would therefore be great if there were a couple of tutorials offering a little advice on the slightly more advanced possibilities that the query can offer you within FH.

For instance – I am trying to write a query that will show all male members of the tree who would have been potentially of age to serve during WW1. I have several family members who were in uniform and I would love to find more.

I guess I must be a bit of a dummy but I can't for love nor money write a query that will show me these names. So far the best that I can do is to segregate the males from the females and despite trying to 'request' names between the ages of 15 & 50 years I have managed to get every male on the tree added to the list and that is just about it.

Clearly I am not up to the task and I am missing something fairly obvious. Maybe one of the more able members would be willing to write a new query and upload it or as I want to learn how to do this myself, maybe they would be willing to write a tutorial offering advice on how to do this.
Pretty please.
Thank you in advance for all those willing to help.
Julie
[smile]

ID:3953

avatar
Bilko
Diamond
Posts: 69
Joined: 04 May 2009 20:03
Family Historian: None

Query on Queries: Say What??

Post by Bilko » 27 Aug 2009 22:14

Hello Julie,

I wrote a query to do {almost} exactly what you have been seeking to achieve and have just uploaded it to the Query Store. It may have a column or two that are not relevant to your requirements so feel free to make a copy and adjust the query as you wish.

The best way I found to learn about queries was to find one almost doing what I wanted and then adjusting it until I achieved my goal. I have enjoyed the challenge and written lots of them mostly aimed at finding information recorded to my own standard.

If you want any assistance, please feel free to mail me directly.

If anyone would like a similar query for WW2, please ask as I have already written that too.

Regards to all
Bilko
[cool]

avatar
ChrisBowyer
Superstar
Posts: 389
Joined: 25 Jan 2006 15:10
Family Historian: None

Query on Queries: Say What??

Post by ChrisBowyer » 28 Aug 2009 05:03

Bilko is absolutely right... Find a query that does something like what you want, save it as a custom query and muck about with it to see what it does. Don't be embarrassed by having trouble getting your head round FH's way of doing it. I do too, and I do this kind of stuff for a living. But it is worth the effort in the long run.

As regards the 'less than' and 'greater than' signs, think of them as a distorted equals. One end of the = is squeezed together and the other end opens out, to form respectively. So the value on the wide end is always bigger than the value on the narrow end. Thus 1 3 reads 'one is less than two' and 'four is greater than three'.

But I suspect your problem is with FH's sequence of 'Add if', 'Add Unless', 'Exclude if' and so on. Think of it as making a list and then adding or removing individuals from it, to refine it to just the ones you want. If you want all the males born between (say) 1865 and 1900, you could do something like (in FH-ese):

Add if %INDI.SEX% matches Male
Exclude if %INDI.BIRT.DATE:YEAR% is null
Exclude if %INDI.BIRT.DATE:YEAR% was earlier than 1865
Exclude if %INDI.BIRT.DATE:YEAR% was later than 1900

'Add if' goes back to all the individuals in your tree and decides whether to add them to your list. 'Exclude if' goes through the list you've already made and decides who to take out (it might have been better named 'Remove if'). The second line is just to remove anyone who doesn't have a year of birth recorded. You might want to take out this line to leave them in. Or possibly use 'Exclude unless' in the other lines, but I think that is even harder to get your head round.

Good luck

User avatar
Jane
Site Admin
Posts: 8442
Joined: 01 Nov 2002 15:00
Family Historian: V7
Location: Somerset, England
Contact:

Query on Queries: Say What??

Post by Jane » 28 Aug 2009 07:21

Chris, in V4 don't forget you can do = etc directly if you prefer.

avatar
JKirkham
Silver
Posts: 5
Joined: 19 Aug 2009 01:01
Family Historian: None

Query on Queries: Say What??

Post by JKirkham » 28 Aug 2009 14:53

Hi Bilko & Chris

I want to thank you both for taking the time to offer some advice and help. Firstly Chris, thanks for the 'Greater than/Less than' pointer. I think after your explaination it does make more sense.

And to Bilko, my new hero of the hour. I have downloaded your query and run it. It does just what it says on the tin. Thank you.

I hope you don't mind but I am going to try and alter it by adding in a column for my custom ID.

Both of you made a very valid point about picking a query that 'almost' does what you want and then play about with it. I am about to go play with the queries and see what damage I can do. [grin]

You guys have been terrific and more importantly very helpful. I will yell for help if I get into difficulties.

Ta muchly.

Julie
[smile]

User avatar
jmurphy
Megastar
Posts: 712
Joined: 05 Jun 2007 23:33
Family Historian: V6.2
Location: California, USA
Contact:

Query on Queries: Say What??

Post by jmurphy » 29 Aug 2009 05:50

Jane also gave me some helpful tips when I asked about constructing queries in this thread;

http://www.fhug.org.uk/cgi-bin/index.cg ... y&num=2717

I was trying to make two queries, one for people who might be in the SSDI, and another to find men for whom a WWII Draft Registration might exist online. (For WWII, the only records that have been released so far is the 'Old Man's Draft', the cohort born on or after April 28, 1877, and on or before February 16, 1897 -- the same age group who might have served in WWI).

Jan

Locked