Page 1 of 1
Expression for Birth Certificate Flag/Icon
Posted: 30 Nov 2013 21:40
by capnkeith
Could some kind person give me an Expression for Indicating on a Diagram any person with a Birth Certificate. At the moment I cannot get it to use "Birth Certificate" from the Source Name or to get it to select from the Types of sources. It also picks up where I have used a census source to calculate an approximate birth date.
I am not having any problem with a Death Cert or the Marriage Cert but I am losing it with the Birth Cert.
Re: Expression for Birth Certificate Flag/Icon
Posted: 30 Nov 2013 22:31
by tatewise
See how_to:using_flags_and_icons|> Using Flags and Icons.
Try one of the following Expressions :
=ContainsText( %INDI.BIRT.SOUR>TITL%, "Birth Certificate", STD )
=ContainsText( %INDI.BIRT.SOUR>ABBR%, "Birth Certificate", STD )
=ContainsText( %INDI.BIRT.SOUR>_TYPE%, "Birth Certificate", STD )
The 1st checks the Source Record long Title field.
The 2nd checks the Source Record Short Title field.
The 3rd checks the Source Record Type field.
Remember that in each case only the 1st BIRT[1] Event and 1st Citation SOUR[1] are being checked.
This is valid because there is usually only one Birth Event, and a Birth Certificate citation should come 1st above all other citations.
The words Birth and Certificate can occur in any order and in any upper/lower case in the chosen field.
Just replace the quoted words with whatever uniquely identifies your Source Records.
You may have just been lucky so far with Marriages and Deaths because they rarely have Census source citations.
It may be wise to use similar Expressions for them too:
=ContainsText( %INDI.FAMS>MARR.SOUR>TITL%, "Marriage Certificate", STD )
=ContainsText( %INDI.DEAT.SOUR>TITL%, "Death Certificate", STD )
=IsTrue(
ContainsText( %INDI.FAMS>MARR.SOUR>TITL%, "Marriage Certificate", STD ) or
ContainsText( %INDI.FAMS[2]>MARR.SOUR>TITL%, "Marriage Certificate", STD ) or
ContainsText( %INDI.FAMS[3]>MARR.SOUR>TITL%, "Marriage Certificate", STD )
)
When joined up on one line handles up to three marriages.
Re: Expression for Birth Certificate Flag/Icon
Posted: 02 Dec 2013 11:01
by johnmorrisoniom
Using the information Mike has provided above, I have tried to create an expression to show an Icon for a Registry office Marriage.
I have used:
Code: Select all
=ContainsText(%FAM.MARR.ADDR%,"Registry Registrar Register",STD)
for 1st marriage
Code: Select all
=ContainsText(%FAM[2].MARR.ADDR%,"Registry Registrar Register",STD)
for 2nd Marriage etc
but this is not working.
Help appreciated please
Re: Expression for Birth Certificate Flag/Icon
Posted: 02 Dec 2013 11:04
by capnkeith
Thanks again for your help Tatewise, it's much appreciated.
Re: Expression for Birth Certificate Flag/Icon
Posted: 02 Dec 2013 11:53
by tatewise
John, there are two problems with your Expressions.
(1) %FAM[9].MARR.ADDR% does not honour any [index] value.
It is not referring to Spouse Family (FAMS) links, but to the Family Record for the displayed couple, which for the two Individuals could be their 1st, 2nd, 3rd... Marriage and not the same index for both.
Use the Data Refs shown in my earlier reply.
e.g. %INDI.FAMS[2]>MARR.ADDR%
(2) =ContainsText() is only true if ALL the listed words appear in the field (in any order, in any case).
So you must either decide which key word works, or use multiple ContainsText() within =IsTrue( A or B ).
In your case just the part word "Regist" would work, because the text does not have be a whole word, and this would match all three alternatives.
Re: Expression for Birth Certificate Flag/Icon
Posted: 02 Dec 2013 11:55
by PeterR
FH Help for the
ContainsText function includes:
A field is deemed to match the text if it contains all of the words in the search text.
An expression such as the following does work OK:
Code: Select all
=IsTrue(ContainsText(%FAM.MARR.ADDR%,"Registry",STD) or
ContainsText(%FAM.MARR.ADDR%,"Registrar",STD) or
ContainsText(%FAM.MARR.ADDR%,"Register",STD))
There is no need for a similar expression using FAM[2], etc.
Re: Expression for Birth Certificate Flag/Icon
Posted: 02 Dec 2013 13:02
by tatewise
Peter said:
There is no need for a similar expression using FAM[2], etc.
Although in many cases this is correct, there are exceptions, and the
Family Historian Sample Project beautifully illustrates this.
Display an
All Relatives Diagram for
Ian Stephen Munro such that his father
Anthony Edward Munro and the spouses
Julia Amanda Fish and
Susan Isabel Dowling and
Nigel Anderson are all shown.
With the
%FAM.MARR.ADDR% data ref Expression set the
Address field to "
Registry" for the following:
The
Marriage of
Julia Amanda Fish and
Anthony Edward Munro.
The
Marriage of
Susan Isabel Dowling and
Nigel Anderson.
In both cases, neither
Anthony Edward Munro nor
Susan Isabel Dowling will show the icon.
As I said, this is because
FAM only refers to the
Family Record of the displayed married couple
Anthony Edward Munro and
Susan Isabel Dowling.
(This
Family Record takes precedence because it has the parents of Diagram root
Ian Stephen Munro.)
For their other spouses only one of the couple are shown for their associated
Family Record.
If these 'other couples' are chosen as a Diagram root, then the situation is reversed.
Whereas if you use the following Expression then the correct spouses always get the icon:
=IsTrue( ContainsText( %INDI.FAMS>MARR.ADDR%, "Registry", STD ) or ContainsText( %INDI.FAMS[2]>MARR.ADDR%, "Registry", STD ) )
Re: Expression for Birth Certificate Flag/Icon
Posted: 02 Dec 2013 13:45
by johnmorrisoniom
Thanks for your help Mike, all displaying correctly now.
I am using a separate expression for each marriage, because I have a different Icon for marriage 1,2,3,4 and 5.
Re: Expression for Birth Certificate Flag/Icon
Posted: 02 Dec 2013 14:09
by tatewise
John said:
I am using a separate expression for each marriage, because I have a different Icon for marriage 1,2,3,4 and 5.
That is fine as long as you realise that the
Nth marriage for one Spouse is not necessarily the
Nth marriage for the other Spouse.
Again the
Family Historian Sample Project illustrates this:
1st Marriage of
Julia Amanda Fish =
1st Marriage of
Anthony Edward Munro.
1st Marriage of
Susan Isabel Dowling =
2nd Marriage of
Anthony Edward Munro.
2nd Marriage of
Susan Isabel Dowling =
1st Marriage of
Nigel Anderson.
So if just the
Marriage for
Susan Isabel Dowling and
Anthony Edward Munro was in a
Registry they would display different icons.
Whereas, the
%FAM.MARR.ADDR% data ref does not suffer this problem, because when it applies it always refers to the same
Family Record Marriage for both spouses, but has the other problems I mentioned above.
Re: Expression for Birth Certificate Flag/Icon
Posted: 02 Dec 2013 14:21
by johnmorrisoniom
Thanks Mike, That is exactly what I wanted to achieve.
Re: Expression for Birth Certificate Flag/Icon
Posted: 20 Jan 2014 14:44
by johnmorrisoniom
I know I can use :
Code: Select all
=ContainsText( %INDI.BIRT.SOUR>_TYPE%, "Birth Certificate", STD )
to put an icon in my diagram scheme, but I can't work out how to expand this to only show an icon when the source has an image attached.
Help please.
Re: Expression for Birth Certificate Flag/Icon
Posted: 20 Jan 2014 15:13
by Jane
Just use the same one as I posted for the other question, with either no wrapper or an exists function.
i.e
%INDI.BIRT[1].SOUR[1]>OBJE[1]>%
or
=Exists(%INDI.BIRT[1].SOUR[1]>OBJE[1]>%)
If you want to combine them use
=IsTrue(ContainsText( %INDI.BIRT.SOUR>_TYPE%, "Birth Certificate", STD ) and Exists(%INDI.BIRT.SOUR>OBJE>%))
Re: Expression for Birth Certificate Flag/Icon
Posted: 20 Jan 2014 15:44
by johnmorrisoniom
Thanks Jane,
I knew the two expressions, but not how to combine them.
Re: Expression for Birth Certificate Flag/Icon
Posted: 20 Jan 2014 16:29
by tatewise
Or perhaps even simpler, shorter, and easier to understand:
=IsTrue((%INDI.BIRT.SOUR>_TYPE% = "Birth Certificate") and Exists(%INDI.BIRT.SOUR>OBJE>%))
The first half is straight out of how_to:using_flags_and_icons_and_expressions#more_example_query_icon_condition_expressions|> Using Flags and Icons and Expressions and the
=IsTrue( ... ) method of combining conditions is there too (the example uses
or but
and is an alternative.
See the FH
Help on
Operators for more info.
Perhaps an explanation is worthwhile:-
Use
%DataRef% = "Text" when the field contents exactly matches the text, such as in
Source Type fields.
Use
=ContainsText(%DataRef%,"Text",STD) when the field contents is not necessarily an exact match, such as in
Source Title or other long text fields, and as explained in the FH
Help:
A field is deemed to match the text if it contains all of the words in the search text. However, they do not have to be whole word matches (e.g. "Hampshire" will match "Shire"), case does not have to match, and the words do not have to be in the same order, contiguous, or even close to each other, in the field in question.