Page 1 of 1
Occupation icons in Diagrams
Posted: 01 Aug 2023 05:51
by rodit
I use icons in Diagrams to show all sorts of things - Immigration, BMD's, Occupations, etc.
Looking over one family of Miners/Colliers in the Yorkshire mines, I noticed that there was no icon for one who had been a Collier.
The Expression I have always used to generate the required icon is:-
=IsTrue(ContainsText(%INDI.OCCU[1+]%,"miner",STD) or ContainsText(%INDI.OCCU[1+]%,"collier",STD))
It finally dawned on me that his icon was not showing because this was his second listed Occupation. His first was that of electrician. I believe that this is the reason, but have been unable to resolve the problem, even though I have ploughed through the KB and a number of topics.
Perhaps Mike Tate could point me in the right direction.
Thanks in advance
Roger
Re: Occupation icons in Diagrams
Posted: 01 Aug 2023 06:16
by sbell95
Roger,
From what I understand, you must iterate through all of the possible occupations manually by index, so my guess would be adding additional expressions which refer to
%INDI.OCCU[2]%,"miner",STD,
%INDI.OCCU[3]%,"miner",STD, etc, in order to capture all possible occupations of a person. I suppose that is what you've tried to do with the
[1+] notation, but I've not seen that before...
Related topic -
https://www.fhug.org.uk/forum/viewtopic ... 584#p85584
Re: Occupation icons in Diagrams
Posted: 01 Aug 2023 08:00
by jelv
Would making it the preferred occupation and adjusting the expression accordingly work for you? If there is no preferred it defaults to the first so you'd only have to set preferred on the individuals where it wasn't the first.
Edit to add screen shot.
Re: Occupation icons in Diagrams
Posted: 01 Aug 2023 08:19
by tatewise
Roger, the [1+] looping index only works in Text Schemes and nowhere else.
So if you want icons for such Occupations you must use one of the techniques suggested by Sarah and John.
This is one of the scenarios where it might be easier to have a Record Flag for each type of Occupation and apply the icon when the Record Flag is set.
BTW: I have never quite understood why the [1+] looping index only applies to Text Schemes.
Re: Occupation icons in Diagrams
Posted: 02 Aug 2023 05:31
by rodit
Thanks to you all. I will take the suggestions on board and see hoe I go.
Roger
Re: Occupation icons in Diagrams
Posted: 02 Aug 2023 07:32
by ississi
how would you change the equation to use the Preferred occupation, then? thanks
Re: Occupation icons in Diagrams
Posted: 02 Aug 2023 07:54
by jelv
%INDI.OCCU[preferred]%
Re: Occupation icons in Diagrams
Posted: 02 Aug 2023 08:02
by jelv
Incidently, often the occupation that is most pertinent is not the first one so in the absence of a preferred it would be best if it defaulted to the last (e.g. if the first is "Scholar" from a census).
There's a wish list item asking for a new index option that does that - if this is something you'd like to see added to FH please vote for it.
New data reference index option "preflast"