* Expressions for Diagram Icons

Questions regarding use of any Version of Family Historian. Please ensure you have set your Version of Family Historian in your Profile. If your question fits in one of these subject-specific sub-forums, please ask it there.
Post Reply
avatar
Shiriki
Diamond
Posts: 70
Joined: 27 Sep 2014 10:09
Family Historian: V7
Location: Dartford, Kent, UK

Expressions for Diagram Icons

Post by Shiriki » 09 Mar 2017 16:09

Hi there

Thought I might share my latest musings and attempts to sort out my expressions to display icons on diagrams.

With reference to my previous posts relating to diagram icons (see Expressions and Icons Again - Success? (14600) and Burial and Interred (or similar) Icons on Diagrams (14653)), I thought it might be nice to display the icon events displayed below an individual’s box in the correct chronological order.

With a diagram displayed and looking at the Diagram Options and Boxes tab, the expressions are shown under the condition column in the order in which they are executed and displayed and hence appear beneath an individual’s box.

My expressions up until now were in the order of Birth, Baptism, 1st Marriage, 2nd Marriage, 1841 Census, 1851 Census, 1861 Census, 1871 Census, 1881 Census, 1891 Census, 1901 Census, 1911 Census, Death, Burial, Cremation.

What started to irritate me was the display showing any marriages preceding all of the census icons even when the respective marriage fell within the range of the 1841 and 1911 censuses or indeed after them. I felt that with a bit of thought and the use of conditional expressions it should be possible to achieve a chronological order to these events.
After some trial and error it seemed that the expressions required would have to cater for marriages prior to the 1841 census as well as after the 1911 census. In addition there would have to be expressions to test for the condition of a marriage which fell between the various census dates, and if so only then display the requisite icon.

I currently use different backgrounds for Marriage icons to differentiate between 1st and 2nd Marriages. (i.e. Black text M on a light green background for 1st Marriage and a black text M on a dark green background for 2nd Marriage).
In the case of a census a different background is used to show one of 3 conditions - whether an individual is shown without a partner, with a 1st partner or with a 2nd partner (the last two in effect 1st and 2nd Marriages).
To that end I have ended up with the following expressions. These cater for an individual having two marriages, but could be extended for 3 or more as necessary.
For clarity I have only extracted Marriage Record (Parish Register) record types from my complete expression set. Hopefully I have entered the dates correctly:


1. =IsTrue(%INDI.SEX% = "Male")
2. =IsTrue(%INDI.SEX% = "Female")
The above 2 expressions allow me to change the appearance of Text and Fill colour etc.) of an individual’s box dependent upon their sex for varying display purposes.
3. =IsTrue((%INDI.BIRT.SOUR>_TYPE% = "Birth Certificate (Original)") and Exists(%INDI.BIRT.SOUR>OBJE>%))
4. =IsTrue((%INDI.BIRT.SOUR>_TYPE% = "Birth Certificate (GRO Certified Copy)") and Exists(%INDI.BIRT.SOUR>OBJE>%))
5. =IsTrue((%INDI.BAPM.SOUR>_TYPE% = "Baptism Record (Parish Register)") and Exists(%INDI.BAPM.SOUR>OBJE>%))
The above 3 expressions display Birth/Baptism icons.
6. =IsTrue((%INDI.FAMS>MARR.SOUR>_TYPE% = "Marriage Record (Parish Register)") and (%INDI.FAMS>MARR.DATE% < DateAt(1841,6,6)) and Exists(%INDI.FAMS>MARR.SOUR>OBJE>%))
7. =IsTrue((%INDI.FAMS[2]>MARR.SOUR>_TYPE% = "Marriage Record (Parish Register)") and (%INDI.FAMS[2]>MARR.DATE% < DateAt(1841,6,6)) and Exists(%INDI.FAMS[2]>MARR.SOUR>OBJE>%))
The above 2 expressions display 1st and 2nd Marriage icons prior to the 1841 census.
8. =IsTrue((%INDI.CENS[year=1841].SOUR>_TYPE% = "Census 1841") and Exists(%INDI.CENS[year=1841].SOUR>OBJE>%))
9. =IsTrue((%INDI.FAMS>CENS[year=1841].SOUR>_TYPE% = "Census 1841") and Exists(%INDI.FAMS>CENS[year=1841].SOUR>OBJE>%))
10. =IsTrue((%INDI.FAMS[2]>CENS[year=1841].SOUR>_TYPE% = "Census 1841") and Exists(%INDI.FAMS[2]>CENS[year=1841].SOUR>OBJE>%))
The above 3 expressions display a Census icon dependent upon one of 3 conditions appertaining to an individual - whether they were shown on 1841 the census without a partner, with a 1st partner (1st Marriage) or with a 2nd Partner (2nd Marriage)
11. =IsTrue((%INDI.FAMS>MARR.SOUR>_TYPE% = "Marriage Record (Parish Register)") and (%INDI.FAMS>MARR.DATE% > DateAt(1841,6,6)) and (%INDI.FAMS>MARR.DATE% < DateAt(1851,3,30)))
12. =IsTrue((%INDI.FAMS[2]>MARR.SOUR>_TYPE% = "Marriage Record (Parish Register)") and (%INDI.FAMS[2]>MARR.DATE% > DateAt(1841,6,6)) and (%INDI.FAMS[2]>MARR.DATE% < DateAt(1851,3,30)))
The above 2 expressions display a 1st and 2nd Marriage icons falling between the 1841 and 1851 censuses.
13. =IsTrue((%INDI.CENS[year=1851].SOUR>_TYPE% = "Census 1851") and Exists(%INDI.CENS[year=1851].SOUR>OBJE>%))
14. =IsTrue((%INDI.FAMS>CENS[year=1851].SOUR>_TYPE% = "Census 1851") and Exists(%INDI.FAMS>CENS[year=1851].SOUR>OBJE>%))
15. =IsTrue((%INDI.FAMS[2]>CENS[year=1851].SOUR>_TYPE% = "Census 1851") and Exists(%INDI.FAMS[2]>CENS[year=1851].SOUR>OBJE>%))
The above 3 expressions display a Census icon dependent upon one of 3 conditions appertaining to an individual - whether they were shown on the 1851 census without a partner, with a 1st partner (1st Marriage) or with a 2nd Partner (2nd Marriage)
16. =IsTrue((%INDI.FAMS>MARR.SOUR>_TYPE% = "Marriage Record (Parish Register)") and (%INDI.FAMS>MARR.DATE% > DateAt(1851,3,30)) and (%INDI.FAMS>MARR.DATE% < DateAt(1861,4,7)))
17. =IsTrue((%INDI.FAMS[2]>MARR.SOUR>_TYPE% = "Marriage Record (Parish Register)") and (%INDI.FAMS[2]>MARR.DATE% > DateAt(1851,3,30)) and (%INDI.FAMS[2]>MARR.DATE% < DateAt(1861,4,7)))
The above 2 expressions display a 1st and 2nd marriage falling between the 1851 and 1861 censuses.
18. =IsTrue((%INDI.CENS[year=1861].SOUR>_TYPE% = "Census 1861") and Exists(%INDI.CENS[year=1861].SOUR>OBJE>%))
19. =IsTrue((%INDI.FAMS>CENS[year=1861].SOUR>_TYPE% = "Census 1861") and Exists(%INDI.FAMS>CENS[year=1861].SOUR>OBJE>%))
20. =IsTrue((%INDI.FAMS[2]>CENS[year=1861].SOUR>_TYPE% = "Census 1861") and Exists(%INDI.FAMS[2]>CENS[year=1861].SOUR>OBJE>%))
The above 3 expressions display a census icon dependent upon one of 3 conditions appertaining to an individual - whether they were shown on the 1861 census without a partner, with a 1st partner (1st Marriage) or with a 2nd Partner (2nd Marriage)

Continue with the above expressions in a like manner up until the 1911 census.
Then to ensure Marriages occurring after this last census apply the following:


I. =IsTrue((%INDI.FAMS>MARR.SOUR>_TYPE% = "Marriage Record (Parish Register)") and (%INDI.FAMS>MARR.DATE% > DateAt(1911,4,2)) and Exists(%INDI.FAMS>MARR.SOUR>OBJE>%))
II. =IsTrue((%INDI.FAMS[2]>MARR.SOUR>_TYPE% = "Marriage Record (Parish Register)") and (%INDI.FAMS[2]>MARR.DATE% > DateAt(1911,4,2)) and Exists(%INDI.FAMS[2]>MARR.SOUR>OBJE>%))
The above 2 expressions display 1st and 2nd Marriage icons after the 1911 census.
III. =IsTrue((%INDI.DEAT.SOUR>_TYPE% = "Death Certificate (Original)") and Exists(%INDI.DEAT.SOUR>OBJE>%))
IV. =IsTrue((%INDI.DEAT.SOUR>_TYPE% = "Death Certificate (GRO Certified Copy)") and Exists(%INDI.DEAT.SOUR>OBJE>%))
V. =IsTrue(((%INDI.BURI.SOUR>_TYPE% = "Burial Record (Parish Register)") and Exists(%INDI.BURI.SOUR>OBJE>%)) or ((%INDI.BURI.SOUR[2]>_TYPE% = "Burial Record (Parish Register)") and Exists(%INDI.BURI.SOUR>OBJE>%)))
VI. =IsTrue(((%INDI.BURI.SOUR>_TYPE% = "Burial Record (Cemetery Register)") and Exists(%INDI.BURI.SOUR>OBJE>%)) or ((%INDI.BURI.SOUR[2]>_TYPE% = "Burial Record (Cemetery Register)") and Exists(%INDI.BURI.SOUR>OBJE>%)))
VII. =IsTrue((%INDI.CREM.SOUR>_TYPE% = "Cremation Certificate (Original)") and Exists(%INDI.CREM.SOUR>OBJE>%))
VIII. =IsTrue((%INDI.CREM.SOUR>_TYPE% = "Cremation Record") and Exists(%INDI.CREM.SOUR>OBJE>%))
The above expressions included to show Death, Burial (Interred) and Cremation icons to complete the customised set.
IX. Sex
X. Box Type
XI. <Default>
The above expressions complete the set (included by default)

The above expressions can be copied and modified to suit dependent upon what you wish to display.
e.g. Baptism expressions could be compiled to show any Baptisms which falls outside or between the census dates , or another complete set of Marriage expressions constructed to take into account the 1939 Register.

As I have at the moment 6 Types of Marriage Record, this has led to a somewhat onerous task of having 12 sets of conditional Mariage expressions inserted between each of the various censuses. So far, including the last entries of Sex, Box Type and <default> this has given me a grand total of 147 expressions.
Is there a limit to the number of expressions?

Notes to self:

a) Look at amending, concatenating or deleting the numerous expressions where possible to reduce the number of expressions (where the same icon is used)
b) Consider additional sets of expressions to cater for other events where an icon is required to display on a diagram.
c) As newly entered expressions appear at the top of the list, when entering same (Copying and pasting from a previously compiled Notepad/Word document), work in reverse order to avoid clicking innumerable times to place the last entered expression towards the end of the listing…..!!!

Below is how the icons appear on diagrams (Any missing icons are due to the fact that either I have yet to discover the record and/or image and enter them within Family Historian.):
Richard Kirk.JPG
Richard Kirk.JPG (145.63 KiB) Viewed 3760 times
The above diagram image taken prior to moving Death, Burial, Interred and Cremation expressions post Census entries and before entering conditional expressions to place Marriage icons in chronological order with respect to the Censuses. Box fill colour and Text expressions also not invoked according to Sex expressions.
Richard Charles Kirk.JPG
Richard Charles Kirk.JPG (73.45 KiB) Viewed 3760 times
The above image shows Richard and his 2 marriages - 1st marriage (1839) and 2nd marriage (1866) correctly positioned between requisite census icons as required. Box fill and Text colours now invoked according to Sex expressions.
Alfred Kirk.JPG
Alfred Kirk.JPG (55.69 KiB) Viewed 3760 times
Considering just Harriett, she is shown appearing on the 1861 and 1871 census without a partner. Then a correctly positioned Marriage icon appears (married 1873) between the 1871 and 1881 icons. The 1881, 1891 and 1901 icons have changed background colour to show that she appears on the censuses with her 1st (and in this case only) partner. The 1911 census icon’s background has reverted to that associated with her appearing without a partner, Alfred having died prior to the 1911 census in 1908.


All seems present and correct, but please feel free to comment if you see any errors to my logic or construction of expressions or any improvement which could be considered.

Many thanks in advance

Shiriki

User avatar
tatewise
Megastar
Posts: 27082
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Expressions for Diagram Icons

Post by tatewise » 09 Mar 2017 16:25

That is certainly very impressive, and shows how far FH can be customised.
I have not checked the expressions in any detail, but they look OK.
As far as the number of expressions allowed, I am not aware of any limits.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
trevorrix
Famous
Posts: 228
Joined: 17 Nov 2002 20:27
Family Historian: V7
Location: Suffolk, England

Re: Expressions for Diagram Icons

Post by trevorrix » 11 Mar 2017 12:46

As an aside, the method to ensure that record flag icons are displayed in chronological order in diagrams, is: Diagram Options > Boxes tab, select Record Flag, Edit Condition. In there, Record Flag Conditions, you can order the icons by using the up and down buttons.
Trevor Rix

avatar
Gowermick
Megastar
Posts: 1629
Joined: 13 Oct 2015 07:22
Family Historian: V7
Location: Swansea

Re: Expressions for Diagram Icons

Post by Gowermick » 11 Mar 2017 13:32

Trevor,
Unfortunately, that doesn't apply to facts with movable dates like marriage and death! Yes you can ensure the census's appear in order, but not movable dates. For example, one individuals marriage may occur between 1861 and 1871, whilst for another it may be between 1841 and 1851! The fixed order of the conditions can't cater for this flexibilty, without a lot of complicated expressions.
Mike Loney

Website http://www.loney.tribalpages.com
http://www.mickloney.tribalpages.com

Post Reply