* Expression for Birth Certificate Flag/Icon

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
User avatar
capnkeith
Famous
Posts: 190
Joined: 09 Mar 2009 17:15
Family Historian: V6.2
Location: Suffolk, England

Expression for Birth Certificate Flag/Icon

Post by capnkeith » 30 Nov 2013 21:40

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.
Keith

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

Re: Expression for Birth Certificate Flag/Icon

Post by tatewise » 30 Nov 2013 22:31

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.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
johnmorrisoniom
Megastar
Posts: 882
Joined: 18 Dec 2008 07:40
Family Historian: V7
Location: Isle of Man

Re: Expression for Birth Certificate Flag/Icon

Post by johnmorrisoniom » 02 Dec 2013 11:01

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

User avatar
capnkeith
Famous
Posts: 190
Joined: 09 Mar 2009 17:15
Family Historian: V6.2
Location: Suffolk, England

Re: Expression for Birth Certificate Flag/Icon

Post by capnkeith » 02 Dec 2013 11:04

Thanks again for your help Tatewise, it's much appreciated.
Keith

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

Re: Expression for Birth Certificate Flag/Icon

Post by tatewise » 02 Dec 2013 11:53

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.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
PeterR
Megastar
Posts: 1129
Joined: 10 Jul 2006 16:55
Family Historian: V7
Location: Northumberland, UK

Re: Expression for Birth Certificate Flag/Icon

Post by PeterR » 02 Dec 2013 11:55

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.
Peter Richmond (researching Richmond, Bulman, Martin, Driscoll, Baxter, Hall, Dales, Tyrer)

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

Re: Expression for Birth Certificate Flag/Icon

Post by tatewise » 02 Dec 2013 13:02

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 ) )
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
johnmorrisoniom
Megastar
Posts: 882
Joined: 18 Dec 2008 07:40
Family Historian: V7
Location: Isle of Man

Re: Expression for Birth Certificate Flag/Icon

Post by johnmorrisoniom » 02 Dec 2013 13:45

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.

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

Re: Expression for Birth Certificate Flag/Icon

Post by tatewise » 02 Dec 2013 14:09

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.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
johnmorrisoniom
Megastar
Posts: 882
Joined: 18 Dec 2008 07:40
Family Historian: V7
Location: Isle of Man

Re: Expression for Birth Certificate Flag/Icon

Post by johnmorrisoniom » 02 Dec 2013 14:21

Thanks Mike, That is exactly what I wanted to achieve.

User avatar
johnmorrisoniom
Megastar
Posts: 882
Joined: 18 Dec 2008 07:40
Family Historian: V7
Location: Isle of Man

Re: Expression for Birth Certificate Flag/Icon

Post by johnmorrisoniom » 20 Jan 2014 14:44

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.

User avatar
Jane
Site Admin
Posts: 8442
Joined: 01 Nov 2002 15:00
Family Historian: V7
Location: Somerset, England
Contact:

Re: Expression for Birth Certificate Flag/Icon

Post by Jane » 20 Jan 2014 15:13

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>%))
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."

User avatar
johnmorrisoniom
Megastar
Posts: 882
Joined: 18 Dec 2008 07:40
Family Historian: V7
Location: Isle of Man

Re: Expression for Birth Certificate Flag/Icon

Post by johnmorrisoniom » 20 Jan 2014 15:44

Thanks Jane,
I knew the two expressions, but not how to combine them.

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

Re: Expression for Birth Certificate Flag/Icon

Post by tatewise » 20 Jan 2014 16:29

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.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

Post Reply