* Adding a Flag
- rodit
- Famous
- Posts: 228
- Joined: 02 Feb 2008 02:39
- Family Historian: V7
- Location: Wollongong, New South Wales, Australia
Adding a Flag
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
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
- tatewise
- Megastar
- Posts: 27084
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Adding a Flag
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.
=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.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
- rodit
- Famous
- Posts: 228
- Joined: 02 Feb 2008 02:39
- Family Historian: V7
- Location: Wollongong, New South Wales, Australia
Adding a Flag
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
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
- tatewise
- Megastar
- Posts: 27084
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Adding a Flag
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)
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)
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
- rodit
- Famous
- Posts: 228
- Joined: 02 Feb 2008 02:39
- Family Historian: V7
- Location: Wollongong, New South Wales, Australia
Adding a Flag
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
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
- tatewise
- Megastar
- Posts: 27084
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Adding a Flag
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.
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.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
- rodit
- Famous
- Posts: 228
- Joined: 02 Feb 2008 02:39
- Family Historian: V7
- Location: Wollongong, New South Wales, Australia
Re: Adding a Flag
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
=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
- tatewise
- Megastar
- Posts: 27084
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Adding a Flag
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...
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...
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
- rodit
- Famous
- Posts: 228
- Joined: 02 Feb 2008 02:39
- Family Historian: V7
- Location: Wollongong, New South Wales, Australia
Re: Adding a Flag
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
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