Page 1 of 1
Adding a Flag
Posted: 01 Jun 2013 06:32
by rodit
Many of my ancestors worked in the Yorkshire pits in the early 1800's, poor souls, and I would like to be able to insert a Miner icon to identify them in diagrams. I believe that I need to create an expression so thet if the word 'miner' is included in their job, the icon will show. (Some are 'coal miner', 'iron stone miner' - he was in Lancashire - and 'miner hewer' as per censuses.
My problem is that I do not seem to be able to write this expression. Would some kind person give me a hand?
Thanks
Roger
ID:6973
Adding a Flag
Posted: 01 Jun 2013 12:34
by tatewise
The simplest Expression to use is:
=ContainsText(%INDI%,"miner",STD)
However, this will search the entire Individual Record for the text miner.
The text does not have to be in the correct upper/lower case, or a distinct word, or in an Occupation Fact.
So it would match the text EXAMINERS in any field.
Alternatively, use an Expression such as:
=IsTrue( ContainsText(%INDI.OCCU%,"miner",STD) or ContainsText(%INDI.OCCU[2]%,"miner",STD) or ContainsText(%INDI.OCCU[3]%,"miner",STD) )
with as many instances of OCCU[?] as necessary, depending on the maximum number of Occupation Facts per Individual.
Unfortunately, this will still match an Occupation such as Examiner.
Inserting a space before and after miner e.g. " miner " does not help.
So a better method is to have separate Condition Expressions for each type of miner e.g. "coal miner", "miner hewer", etc.
Finally, this may be one of those rare cases where a Miner Flag is the only foolproof solution.
Adding a Flag
Posted: 02 Jun 2013 06:13
by rodit
Thanks, Mike
Initially I used the first suggestion but, as you said, this found 'miner' in some of the text/notes attached to their wives.
Changed to the longer suggestion and, hey presto, fixed it up.
Thanks again.
Roger
Adding a Flag
Posted: 02 Jun 2013 14:15
by tatewise
A foolproof alternative is to add a Descriptor to the Occupation Fact.
Then the Diagram Boxes Condition Expression becomes:
=IsTrue((%INDI.OCCU.TYPE% = "Miner") or (%INDI.OCCU[2].TYPE% = "Miner") or (%INDI.OCCU[3].TYPE% = "Miner"))
Unfortunately, the Descriptor can only be added on the All tab of the Property Box.
Right-click the Occupation Fact, choose Add Descriptor, and enter Miner into the box.
If the Descriptor is made unusual enough, such as {<Miner>}, then the original Condition Expression will become foolproof:
=ContainsText(%INDI%,"{<Miner>}",STD)
Adding a Flag
Posted: 03 Jun 2013 06:01
by rodit
Now my head is spinning!
I'd never heard of Descriptors. There is no mention of them in Help or the Book.
I entered one as a trial but it didn't seem to make any difference to Reports.
I will stick with your original seconf option.
Roger
Adding a Flag
Posted: 03 Jun 2013 09:28
by tatewise
You are correct, Descriptor is a rarely used GEDCOM field, and only appears by default in Publish > Record Detail Reports > Individuals, etc.
It may also be customised to appear in Diagrams by using Data Refs such as %INDI.OCCU[1+].TYPE%.
That it is rarely used, and rarely appears in Reports/Diagrams, is an advantage in this case, because its contents can be made unique for detection by the Boxes Condition Expression without affecting Reports or Diagrams.
Re: Adding a Flag
Posted: 28 Nov 2013 05:19
by rodit
Last June I asked how to show a flag for my ancestors who were miners. Tatewise gave the following Expression:-
=IsTrue( ContainsText(%INDI.OCCU%,'miner',STD) or ContainsText(%INDI.OCCU[2]%,'miner',STD) or ContainsText(%INDI.OCCU[3]%,'miner',STD) )
This worked fine until I recently updated from Windows XP to Windows 7, 64bit. It now tells me that the 'Expression is not Valid". Where have I gone wrong?
Roger
Re: Adding a Flag
Posted: 28 Nov 2013 11:16
by tatewise
I presume you have used Copy & Paste from above to re-insert the Expression.
What has happened is that when the FHUG website switched to its new servers earlier this year, the double quotes (") have become single quotes ('), and I have now corrected that.
But more importantly, why are you reinserting the Expression, as it should have migrated from XP to Windows 7 if you transferred all your custom settings such as Diagram Expressions.
See how_to:move_settings|> Move Family Historian Settings & Projects from PC to PC.
The easiest way is to use the Plugin Backup and Restore Family Historian Settings, which may still be worth doing if you are missing other customised Diagrams, Reports, Queries, etc, etc...
Re: Adding a Flag
Posted: 02 Dec 2013 02:00
by rodit
Thanks Tatewise
Mea culpa. I just used a full backup from a thumb drive. However, my little miner flags are now back, thank you.
I didn't have many other custom things and had replaced them prior to finding this problem.
Roger