Creating a Query

Introduction

Family Historian comes with a large selection of Standard Queries and there are a large number of user provided queries in the Downloads and Links ~ Queries section, but sooner or later you will probably want to write your own Custom Query. See Index for related topics.

The most popular downloads are for Query Type: Individual and Query Type: Fact. See Query Types below.

Advice

A good place to start is the Creating a Married Women Query animated tutorial.

You could also work through the Manual and Tutorials supplied with Family Historian. Use the book Getting the Most From Family Historian and examine Chapter 12/13/17 Introduction to Queries and Chapter 13/14/18 Writing Custom Queries.

After that, the following advice may help to overcome any initial trepidation.

Query Window

To open the Query Window use View > More Workspace Windows > Query Window or click on the toolbar icon with the Query Window tooltip. See Index for related topics.

Press the F1 key on your keyboard and explore the Help pages for the Query Window and its tabs.

There are two ways to create a Custom Query and both use the Query Menu which is the icon near the top right corner that looks like a cog wheel (or in earlier versions a list with a red tick).

  1. Use Query Menu > New Custom Query, enter a Query Name of your choice and click Create.
  2. Choose an existing Query and use Query Menu > Save As Custom Query, enter a Query Name of your choice and click Save.

This is necessary because, unlike Standard Diagrams and Standard Reports, you cannot change Standard Queries.

The Query Window

The Query Window has four tabs that are described in the following subsections.

Query Types

Newcomers to Queries often do not realise that there are many Query Types. There is one for each main Record Type such as Individual, Family, Source & Media, plus the special Fact Query Type that focusses on Facts. The distinction between the different Query Types is explained below. See Index for related topics.

Individual Query

This is the most popular of the record Query Types. An Individual Query focusses on Individual Records, but the Columns and Rows can refer to any items, including other records, that are linked to an Individual Record. So for example can include, each in a different Column, linked Source or Media records, or Individual records that hold relatives of the original record such as child, parent, grandparent, etc.

BUT each Row in the Result Set is keyed to just one unique Individual Record, and that record is only represented on one Row.

Similar scenarios apply to each of the other record Query Types that focus on their Record Type.

Fact Query

A Fact Query focusses on Facts, not records, but the Columns and Rows can refer to any items, including records, associated with a Fact. So for example can include, each in different Column, the Individual or Family record that owns the Fact, or any Source records cited by the Fact.

BUT each Row in the Result Set is keyed to just one unique Fact, and that Fact is only represented on one Row.

Differences

Now let us examine some of the differences.

With an Individual Query each Row refers to one unique Individual Record. So to show Facts in the Result Set will require a Column for every field of each and every type of Fact plus each and every instance of multiple Facts such as Census. That could run to dozens if not hundreds or thousands of Columns!

With a Fact Query each Row refers to one Fact. So its fields such as Date, Place & Address only need a few Columns. Its owner record, which could be an Individual or a Family record, can occupy a Column. Thus the same Individual Record can appear on many Rows, once for each Fact that it owns. Similarly, any Source or Media record linked to a Fact could appear on many Rows.