Introduction
These are an advanced feature of Family Historian, and occur in a variety of contexts where it is needed to extract and/or act on and/or compare data values.
- QueriesQuerying is a very powerful feature that allows you to specify and save criteria for identifying a set of records of a given record type. to specify Columns, Row filters, and Titles
- Diagram Text Schemes to define the content of Diagram Boxes
- Diagram > Options > Boxes > Conditions to define box style since ƒh V4
- Reports to define Data items in certain Report Sections
- Customise or Print Records WindowThe Records Window provides a comprehensive view of all the information stored within a Family Historian project. Columns or Named ListNamed Lists are a way in FH to group related items — which can be records of any type(s) — so that you can easily find them to work with. Columns
- Captions and Custom Fields in Property Boxes
- Narrative Report Fact Sentence Templates since ƒh V6
- Override Templates for Fact displays since ƒh V6
See (ƒh7) Expressions and Contexts of Use or (ƒh6) Expressions and Contexts of Use for a fuller list.
Expressions
Expressions are composed from two technical features:- Data ReferencesData references are expressions which are used to provide a way of referring to particular items of data in your project, such as records or particular fields within records. They can be used for advanced customizations of diagrams, websites, family, that often appear enclosed within percentage signs, e.g.
%INDI.BIRT%
- FunctionsA 'function' is an expression which returns values based on computations. Typically, functions require data to be supplied to them as 'parameters'. A function in Family Historian is similar to a 'function' as used in spreadsheet applications (such as MS, that begin with an = sign (except when used within another Function), e.g.
=RecordId()
They also often involve Operators such as + - * / = < >
and or etc.
If having trouble displaying all the text in fields such as Note or Text From Source[/glossary-ignore}, see Display long text such as Notes.
Examples
INDI.BIRT
, INDI.BAPM
, INDI.CENS
, INDI.RETI
, INDI.DEAT
, and even just INDI
or INDI.NAME
can often be substituted for each other, but Family Facts such as INDI.FAMS>MARR
or INDI.FAMS>DIV
or CUR_FAMS>MARR
are different.
Record Id
ExpressionExpressions are composed from two technical features: Data References and Functions; they also often involve Operators to compare values. | Description |
---|---|
=RecordId( ) |
Record Id of current record, usually INDIvidual |
=RecordId( %SOUR% ) |
Record Id of current SOURce recordSource: "where information was found". This could be anything from an archive in a county records office, a book, or even a relative's recorded recollection. Citing your Sources helps to show how you reached a particular conclusion about an Individual. |
=RecordId( %INDI.~SPOU>% ) |
Record Id of current Spouse Individual recordEvery person in your tree will have a single Individual Record, which holds all the information about that individual that you have entered. You can view and edit Individual records in the Property Box Dialogue. |
=RecordId( %INDI.FAMC>% ) |
Record Id of current Parents Family record |
Fact & Name Fields
Expression | Description |
---|---|
=Exists( %INDI.RETI.DATE% ) |
True if 1st Retirement Event has a Date defined |
=Exists( %INDI.BAPM.SOUR>% ) |
True if 1st Baptism Event has a Source Citation |
=Exists( %INDI.CENS[year=1901]% ) |
True if any CensusCensus records are national collections of population statistics. They usually record details about members of a household on a particular date, and are typically collected every ten years. Event has a Date in 1901 |
=Exists( %FAM.MARR.PLAC% ) |
True if 1st Marriage Event has a PlaceAccording to GEDCOM, a Place should hold "The jurisdictional name of the place where the event took place…" defined |
=Exists( %INDI.FAMS>MARR.PLAC% ) |
An alternative to the preceding example |
=Exists( %INDI.FAMS[2]>MARR.PLAC% ) |
Similar alternative, but for a 2nd Marriage Event |
=ExistsText( %INDI.~CHIL>%, Text( %INDI.~CHIL>% . " (" . LifeDates2(%INDI.~CHIL>%) . ")" ) ) |
Gives 1st Child’s Name and bracketed Life DatesWhen an Event happened, or an Attrribute was true. |
=TextPart( %INDI.BIRT.PLAC%, 3, 1, STD ) |
Gives 3rd comma separated part of Birth Place |
=TextPart( %INDI.DEAT.ADDR%, 2, 0, TIDY ) |
Gives 2nd and subsequent tidied parts of Death Address"The address structure should be formed as it would appear on a mailing label…", according to GEDCOM; however, this is capable of a number of interpretations, and Address and Place are best considered together. |
=IsTrue( %INDI.RELI% = "Roman Catholic" ) |
True if ReligionThe GEDCOM specification says that the Religion attribute should be used for the religious denomination to which a person is affiliated or for which a record applies. attribute value is Roman Catholic |
=IsTrue( ( AgeAt( %INDI%, %INDI.DEAT.DATE% ) >= 1 ) and ( AgeAt( %INDI%, %INDI.DEAT.DATE% ) <= 5 ) ) |
True if died aged between 1 and 5 years (needs a Birth & Death Date) |
=IsTrue( AgeAt( %INDI%, EstimatedDeathDate( %INDI%, MID, 2 ) ) < 21 ) |
True if died aged less than 21 years (needs a Birth & Death, Burial, or Cremation Date) |
=IsTrue( %INDI.BIRT.DATE:XDATETYPE%="Date" and %INDI.BIRT.DATE:DAY%>0 ) |
True if simple exact Date with Day, Month & Year |
=GetField( %INDI%, "%INDI.CENS[year=" . ["Year"] . "]%" ) |
Compose complex Data Reference with Query prompt |
=FieldText( GetRecord(%FACT%), 'INDI.NAME:SURNAME' ) |
List Surname of owner of Fact in a Query |
=FieldText( FactOwner(%FACT%,1,MALES_FIRST), 'INDI.NAME:SURNAME_FIRST ') |
List in Surname order with Surname first |
=Field( FactOwner(%FACT%,1,MALES_FIRST), 'INDI.NAME:SURNAME_FIRST' ) |
List in Surname order with Surname last |
Typically %INDI.XXXX…%
above can be replaced by %FACT…%
in Fact Queries.
Source Citation Fields
Expression | Description |
---|---|
=IsTrue( %INDI.CENS[year=1871].SOUR>_TYPE% = "Census" ) |
True if a Census Event in 1871 has 1st Source Citation with a Type of Census |
=ContainsText( %INDI.BAPM.SOUR>TITL%, "Baptism", STD ) |
True if 1st Baptism Event has 1st Source Citation with its Title/Name containing Baptism (Note STD is default and thus optional) |
=IsTrue( Exists( %INDI.FAMS>MARR.SOUR>% ) or Exists( %INDI.FAMS[2]>MARR.SOUR>% ) or Exists( %INDI.FAMS[3]>MARR.SOUR>% ) ) |
True if 1st or 2nd or 3rd Marriage Event has a Source Citation |
=ContainsText( %CUR_FAMS>MARR.SOUR>TITL%, "Marriage" ) |
True if 1st Marriage Event has 1st Source Citation with Title/Name containing Marriage for use in Diagrams in ƒh V6 |
=IsTrue( ( %INDI.BIRT.SOUR>_TYPE% = "Birth" ) or ( %INDI.BIRT.SOUR[2]>_TYPE% = "Birth" ) ) |
True if 1st Birth Event has 1st or 2nd Source Citation with a Type of Birth |
=IsTrue( ContainsText( %INDI.BAPM.SOUR>TITL%, "Baptism" ) or ContainsText( %INDI.BAPM.SOUR[2]>TITL%, "Baptism" ) or ContainsText( %INDI.BAPM.SOUR[3]>TITL%, "Baptism" ) ) |
True if 1st Baptism Event has 1st or 2nd or 3rd Source Citation with its Title/Name containing Baptism |
Typically %INDI.XXXX…%
above can be replaced by %FACT…%
in Fact Queries.
Relationships
Expression | Description |
---|---|
=IsAncestorOf( %INDI%, FileRoot() ) |
True for all Ancestors of the File Root |
=IsAncestorOf( %INDI%, Field( FileRoot(), 'INDI.~FATH>' ) ) |
True for paternal Ancestors of File Root |
=IsAncestorOf( %INDI%, Field( FileRoot(), 'INDI.~MOTH>' ) ) |
True for maternal Ancestors of File Root |
=Relationship( FileRoot(), %INDI% ) |
Textual relationship of Individual to File Root |
=Relationship( %CUR_FILE_ROOT%, %INDI% ) |
Textual relationship of Individual to File Root in FH V6 |
=Relationship( FileRoot(), %FAM.HUSB>% ) |
Textual relationship of Husband of Family to File Root |
%INDI.NAME:ADORNED_FULL% (=LifeDates2()) is =Relationship( FileRoot(), %INDI% ) of =FileRoot() |
Individual Summary Report > Report > Options > Format > Heading > Record with relationship of Individual to File Root |
%INDI.NAME:ADORNED_FULL% (=LifeDates2())=TextIf( IsRelativeOf( FileRoot(), %INDI% ), Text( " is " . Relationship( FileRoot(), %INDI% ) . " of " . FileRoot() ), "" ) |
As above, but copes with an unrelated Individual |
{default} are =Relationship( FileRoot(), %FAM.HUSB>% ) and =Relationship( FileRoot(), %FAM.WIFE>% ) of =FileRoot() |
Family Group Sheet > Report > Options > Format > Heading > Record with relationship of each Spouse to File Root |
Sentence Templates
These are found in Tools > Fact Types > Edit and affect Narrative Reports as discussed in Narrative Report Fact Sentence Templates.
The following are alternatives to the word married in the Marriage Event default Sentence Template.
Expression |
Description |
---|---|
{=TextIf( %CUR_PRIN.SEX% = %CUR_PRIN2.SEX%, "entered a Civil Partnership with", "married" )} |
Same Sex Civil Partnership |
{=CombineText( "entered a ", GetLabelledText( %FACT.NOTE2%, "Status: " ), " with", "married" )} |
Labelled Note Status: Ceremony |
Override Templates
These are found in Tools > Fact Types . Select a Fact and then the Edit button and then Advanced.They affect Fact displays in the Property BoxThe Property Box is the primary window for data entry and for viewing details of stored records. It is used with records of all types. Facts tab and the Records Window Individuals tab. These examples indicate the presence (*) or lack (-) of Sources and presence (+) or lack (-) of MediaWhen you add a picture, video, sound recording, document file etc into a Family Historian project, a Media record is created to represent that media item within the project; the Media record includes a link to the actual Media file. for each Fact. Note how using {abbr} {value} {place} adds the Place field to AttributesEvents are things that happened to an Individual and Attributes are things that described them. that do not include it by default. For another example see Witness Facts.
Expression | Description |
---|---|
{=TextIf( Exists(%FACT.SOUR>%),"*","-" )}{=TextIf( Exists(%FACT.SOUR>OBJE>%),"+"," -")} {abbr} {value} {place} |
Source & Media in Facts tab |
{=TextIf( Exists(%FACT.SOUR>%),"*","-" )}{=TextIf( Exists(%FACT.SOUR>OBJE>%),"+"," -" )} {abbr} {date} {place} |
Similarly for Records Window |
{=TextIf( Exists(%FACT.SOUR>%),"*","-" )}{=TextIf( Exists(%FACT.SOUR.OBJE>%),"+"," -" )} {abbr} {value} {place} |
Citation & Media in Facts tab |
ƒh V6.1 and above can show a Media icon in the Facts tab More column if any Media are attached to the Fact, its CitationsA link between a source and a fact, documenting Where within the source you find information being "cited" to support the fact/conclusion., or its Sources.