Page 1 of 1

Displaying Occupations in Diagrams

Posted: 26 Jan 2014 15:42
by leperstone
An individual may through different sources have their occupation recorded as a fact many times over the lifetime. Often the occupation remains the same. Any diagram text options I have tried that list occupations seem to show all occupation data for an individual making the diagrams untidy.

I want to be able to select/show one occupation entry only for an individual in diagrams, Is this possible. Any help would be appreciated

Re: Displaying Occupations in Diagrams

Posted: 26 Jan 2014 16:24
by AdrianBruce
Multiple value items generally show something like %INDI.NAME[2+]:FULL%

OK, that's for name, not occupations, but the crucial bit is that [2+]. This says, show "occurrence two upwards". So the multiple occurrences of occupation probably have [1+]. If you remove the whole thing in square brackets (e.g. to make %INDI.NAME:FULL% ) then you will see just the first occurrence of occupation.

Now, of course, someone's first occupation may not be the one you want to show, so you have two choices.

1. Shuffle the facts up and down so that the most important occupation is always first. Or...
2. Create a new custom fact (an attribute) to be used exclusively for holding a bit of text that you want to appear against that person in a diagram. For instance, I created a custom attribute "zDiagram Note" (no quotes in the real fact name) to hold things like someone's main occupation or where they were suspected to be from or... Then this is printed with the line
(%INDI._ATTR-ZDIAGRAM_NOTE%)
in the relevant text scheme to show the note in brackets.

Re: Displaying Occupations in Diagrams

Posted: 26 Jan 2014 17:20
by tatewise
Other users have a similar requirement, and it has been suggested that what is needed is some way to indicate which Occupation entry is the Primary one, but nothing has been provided yet.

However, there are a number of ways to achieve what you ask for.

(1) Custom Attribute
You could create a Custom Attribute for Primary Occupation and then the Text Scheme would simply display that Custom Attribute as per Adrian's suggestion above.
The Template would be similar to:

Code: Select all

Occup. %INDI._ATTR-PRIMARY_OCCUPATION%
However, you may also want to exclude that Custom Attribute from Reports to avoid duplication.

(2) Unique Occupation
Where an Individual has multiple Occupation Attributes there needs to be something to make one of them unique.
Two suggestions are to use the Cause field or the Source Note field, neither of which are likely to be used in practice for anything else.
You will have to use the All tab to add a value such as Primary to either such field for the chosen Occupation.
Then the Text Scheme must selectively display just that Occupation by using a Template such as:

Code: Select all

Occup. =TextIf(%INDI.OCCU.CAUS%="Primary",%INDI.OCCU%,TextIf(%INDI.OCCU[2].CAUS%="Primary",%INDI.OCCU[2]%,TextIf(%INDI.OCCU[3].CAUS%="Primary",%INDI.OCCU[3]%,)))
Simply use SOUR2 instead of CAUS to test the Source Note instead of Cause field.

You will have to keep nesting TextIf() functions until enough Occupations are supported.
If there are a lot, the Template may get too long, and then you will need to repeat the Text Scheme item for the larger indexes.

Explanation:
The basic =TextIf( condition, true-text, false-text ) function is:
=TextIf(%INDI.OCCU.CAUS%="Prime",%INDI.OCCU%,)
In this case if the 1st Occupation is Prime then it is displayed, otherwise, nothing is displayed.

The blank false-text parameter must be replaced by a nested TextIf() function:
=TextIf(%INDI.OCCU.CAUS%="Prime",%INDI.OCCU%,TextIf(%INDI.OCCU[2].CAUS%="Prime",%INDI.OCCU[2]%,))
Now if the 1st Occupation is NOT Prime, but the 2nd Occupation is Prime then it is displayed.

This pattern can be repeated for the 3rd, 4th, etc, Occupation until the Template becomes too long.

Re: Displaying Occupations in Diagrams

Posted: 26 Jan 2014 18:39
by PeterR
If you always want to show the last Occupation, you can use:

Code: Select all

%INDI.OCCU[last]%
or, to show the relevant Place as well:

Code: Select all

%INDI.OCCU[last]%, %INDI.OCCU[last].PLAC:SHORT%