* Matching Census and Occupation dates in Diagrams

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
rodit
Famous
Posts: 228
Joined: 02 Feb 2008 02:39
Family Historian: V7
Location: Wollongong, New South Wales, Australia

Matching Census and Occupation dates in Diagrams

Post by rodit » 03 Jul 2017 06:03

I include Census date and places in Diagrams as =ExistsText(%INDI.CENS[1+]%,"Census:") %INDI.CENS[1+].DATE:COMPACT% in %INDI.CENS[1+].PLAC:SHORT%, and am trying to attach the Occuption where it exists. However, using %INDI.OCCU[1+]% only lists the Occupations in order they are listed, when I wish to tie them to the Census - see attachment.
Obviously Isaac Mellor was not working underground in April 1881 at 1 month of age.
How do I edit (if possible) the Occupation to match the Census date?

Thanks

Roger
Attachments
FH Mellor.JPG
FH Mellor.JPG (31.22 KiB) Viewed 3828 times

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

Re: Matching Census and Occupation dates in Diagrams

Post by Jane » 03 Jul 2017 11:16

Something like this works, but obviously it will only list Occupations for the same year as Censuses

Code: Select all

%INDI.CENS[1+].DATE:COMPACT% in %INDI.CENS[1+].PLAC:SHORT%   
=GetFieldText(%INDI%,"%INDI.OCCU[YEAR=" . Text(%INDI.CENS[1+].DATE:YEAR%) . "]%")
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."

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

Re: Matching Census and Occupation dates in Diagrams

Post by tatewise » 03 Jul 2017 13:17

I wonder if all that needs a little explanation.

Firstly, the looping [1+] index will lump all similar facts together.
So all the CENSus facts will be listed together, and all the OCCUpation facts will be listed together.

Jane's expression uses the CENS[1+] looping index to list every Census fact.

You do not need the =ExistsText(...) function because only existing Census facts will be included by default.

The =GetFieldText(...) function is very powerful as it allows the data reference to be composed from various components.
The %INDI% parameter identifies the record to which the data reference applies.
The data reference uses format %INDI.OCCU[year=1891]% but the actual year is got from %INDI.CENS[1+].DATE:YEAR%.
The dot ( . ) character between each component is the text concatenation operator that joins them together.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
rodit
Famous
Posts: 228
Joined: 02 Feb 2008 02:39
Family Historian: V7
Location: Wollongong, New South Wales, Australia

Re: Matching Census and Occupation dates in Diagrams

Post by rodit » 04 Jul 2017 04:46

Jane and Mike
Thank you both. The string (?) worked perfectly. As for not getting all occupations, there are some that are missed out (weddings, etc.) but my main idea is there.
The explanation of all the terms was also very useful.
Thanks again
Roger

Post Reply