Page 1 of 1

Matching Census and Occupation dates in Diagrams

Posted: 03 Jul 2017 06:03
by rodit
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

Re: Matching Census and Occupation dates in Diagrams

Posted: 03 Jul 2017 11:16
by Jane
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%) . "]%")

Re: Matching Census and Occupation dates in Diagrams

Posted: 03 Jul 2017 13:17
by tatewise
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.

Re: Matching Census and Occupation dates in Diagrams

Posted: 04 Jul 2017 04:46
by rodit
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