* Query on occupations

Questions regarding use of any Version of Family Historian. Please ensure you have set your Version of Family Historian in your Profile. If your question fits in one of these subject-specific sub-forums, please ask it there.
Post Reply
User avatar
Verkadej
Newbie
Posts: 3
Joined: 15 Nov 2019 13:26
Family Historian: V6.2
Location: Uelsen, Lower Saxony, Germany
Contact:

Query on occupations

Post by Verkadej » 15 Nov 2019 15:44

I am running a query on occupations with the following colums:
- Name
- Occuption
- Occupation Date
- Occupation Place

Where a person can have more than one occupation (as well at the same time as sequential), the result of above query gives however no more than one result for each person.

Being a new user, perhaps I make a silly mistake, but some advise in finding it would be very helpfull.

User avatar
davidf
Megastar
Posts: 951
Joined: 17 Jan 2009 19:14
Family Historian: V6.2
Location: UK

Re: Query on occupations

Post by davidf » 15 Nov 2019 16:03

Welcome to FHUG

Are you running a query on Individuals or Facts?

I think you need to select "Facts" in the General Tab
Then in the Rows Tab "Excluded Unless =FactLabel(%FACT%) matches "Occupation"

That works for me
David
Running FH 6.2.7. Under Wine on Linux (Ubuntu 22.04 LTS + LXDE 11)

User avatar
tatewise
Megastar
Posts: 27089
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Query on occupations

Post by tatewise » 15 Nov 2019 16:12

Welcome to the FHUG.

Yes, there are some key features of Queries that trip up newcomers.

With Individual type Queries the Result Set only ever has one row per Individual record.
So, to show more than one fact such as Occupation there must be a Column for each one.
Thus, as well as %INDI.OCCU[1]% there must be Columns for %INDI.OCCU[2]%, %INDI.OCCU[3]%, etc, etc, for the Occupation fact instances [1], [2], [3], et seq.

That becomes tedious and produces a very wide Result Set to cope with many facts, which is where the Fact type Query comes into its own, that has one row per Fact in the Result Set.
See the FH command View > Standard Queries > All Facts (and All Events) for example.
Click on the Fact Type column heading to sort into order and all the Occupation facts will be listed together.

In the fhugdownloads:contents:query_all_facts_filter_by_date_label_or_text|> Query:Fact ~ All Facts Filter by Date, Label, or Text there are custom examples such as All Facts Filter by Label that with the Label set to Occupation will list just the Occupation facts.

See how_to:creating_a_query|> Creating a Query for more details under Query Types.

As a newcomer I advise you also study how_to:key_features_for_newcomers|> Key Features for Newcomers.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
dewilkinson
Superstar
Posts: 280
Joined: 04 Nov 2016 19:05
Family Historian: V7
Location: Oundle, Northamptonshire, England
Contact:

Re: Query on occupations

Post by dewilkinson » 15 Nov 2019 17:19

As a matter of interest I have chosen to avoid this complication for occupations by just having one undated Occupation Fact per individual e.g. "agricultural labourer then a yeoman". The dates for these entries will appear in the Fact note sentence that gave rise to them, e.g. census, marriage, baptism etc records.
David Wilkinson researching Bowtle, Butcher, Edwards, Gillingham, Overett, Ransome, Simpson, and Wilkinson in East Anglia

Deterioration is contagious, and places are destroyed or renovated by the spirit of the people who go to them

User avatar
tatewise
Megastar
Posts: 27089
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Query on occupations

Post by tatewise » 15 Nov 2019 17:28

OK, but it is not practical to adopt that for all multiple facts, such as Census and Marriage events.
So the Fact Query approach is still needed for those.
It is also more difficult to search for Date related facts if not using the Date field.
How do you cope with someone who had say a dozen different Occupations as that would be a long list in the value field?
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
dewilkinson
Superstar
Posts: 280
Joined: 04 Nov 2016 19:05
Family Historian: V7
Location: Oundle, Northamptonshire, England
Contact:

Re: Query on occupations

Post by dewilkinson » 15 Nov 2019 17:54

I know that approach doesn't work for other things like census that have to have dates. For multiple occupations I record them in the single record such that it forms a reasonable sentence in reports, which is my ultimate aim. I think having multiple entries for occupations (also separate Residence Facts for census's etc.) are unnecessary as the detail is in Fact and they lead to tedious reports. It is personal choice for the way I wish to present my data. Below is an example of the opening paragraph for my grandfather. Dates for those occupations will appear later on in the entry from which they are derived.
Capture.JPG
Capture.JPG (29.06 KiB) Viewed 4916 times
David Wilkinson researching Bowtle, Butcher, Edwards, Gillingham, Overett, Ransome, Simpson, and Wilkinson in East Anglia

Deterioration is contagious, and places are destroyed or renovated by the spirit of the people who go to them

User avatar
Verkadej
Newbie
Posts: 3
Joined: 15 Nov 2019 13:26
Family Historian: V6.2
Location: Uelsen, Lower Saxony, Germany
Contact:

Re: Query on occupations

Post by Verkadej » 15 Nov 2019 18:31

Getting a step closer with the All Facts Filter approach. A remaining question is how I can combine that with criteria for the (occupation)Place. More specifically, I would only want to see occupations related to an occupation_place starting with #

The background is that I make a study of how a limited number of families ruled nearly all companies in a specific region during the 19th century. Therefore I (ab)used the occupation_place for entering the company name, preceeded by a "#".

Any suggestions?

User avatar
tatewise
Megastar
Posts: 27089
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Query on occupations

Post by tatewise » 15 Nov 2019 19:07

There are many examples in fhugdownloads:queriesfact|> Downloads and Links ~ Query Type: Fact.

In particular fhugdownloads:contents:list_baptisms_and_burials_for_specific_places|> Query:Fact ~ List Baptisms and Burials for Places is very similar to your requirement.
Just use Occupation instead of Baptism/Burial in the =FactLabel(%FACT%) filter.
Use begins with instead of contains in the %FACT.PLAC% filter.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
Verkadej
Newbie
Posts: 3
Joined: 15 Nov 2019 13:26
Family Historian: V6.2
Location: Uelsen, Lower Saxony, Germany
Contact:

Re: Query on occupations

Post by Verkadej » 16 Nov 2019 07:57

Thank you, Mike, that brought the result I was after. Meanwhile found the topics "Understanding Data References" and "Understanding Functions" of which I hope that they will guide me further.

Post Reply