Workspace Windows
The Query Window

the Purpose of the Query Window
The Query Window is used for two purposes:
- for running and maintaining queries
- for viewing and maintaining smart folders
These roles overlap to an extent because smart folders contain, or can contain, queries. So maintaining smart folders may also involve maintaining the queries contained within them.
Smart Folders
Whereas the output of a query can only be viewed in the Query Window, the same is not true of most smart folders. Smart folders can also be viewed in the Records Window, or in record selector dialogs. However, there are some smart folders (smart folders that are related to non-record data items like source citations, facts, or witnesses) which can only be viewed in the Query Window.
Click on the Smart Folder icon
on the Query
Window toolbar to open the Smart Folder Pane.
The rest of this page, and the pages it links to, describe the primary
use of the Query Window, which is for running and maintaining queries.
See Smart Folders to learn more
about smart folders generally. To learn about using the Query
Window to view and maintain smart folders, see Smart
Folders in the Query Window.
Queries
A query is a reusable set of
instructions for extracting information from a Family Historian project.
The information returned by a query is called a result
set, and it is laid out in tabular form, in a grid of
rows and columns. There are 15 types of query - one for each of the 12
record types (excluding the header record), one for facts (events or
attributes), one for source citations, and one for witnesses (shared
events). If the query is an Individual
query, each row returned, and displayed in the result set, will
correspond to an Individual record. If it is a Source
query, each row will correspond to a Source record. With fact
queries, each row corresponds to a fact. With source citation
queries, each row corresponds to a source citation. And with
witness queries, each row corresponds to an instance of a person having
a role as a witness (non-principal participant) in an event.
An example might be a person being a best man at a wedding, or a person
being the beneficiary of a will.
To open the Query Window, click on the button
on the main
application toolbar and select the query you want to run from the
dropdown menu that appears. You can also open the Query Window
without running a query by choosing the Query Window command
(the first item on the dropdown menu). You can run any query from
within the Query Window itself if you want to. To do this, make
sure that your required query is selected in the query toolbar at the top of the Query Window, and
click the Run button
to run
it. When you run a query, you may be required to make choices and
selections. Some queries prompt you to supply information or make
choices when you run them. Some do not. Either way, the
results will be displayed in The
Result Set Tab.
If you want to create a new query, click on the button
on the main
application toolbar and choose New Custom Query.
If the Query Window is already open, you can also create a new query by
clicking on the Menu button
on the query toolbar and choosing New Custom Query
from the dropdown menu that appears.
When Family Historian is installed, it comes with a set of queries
ready for use. These are called standard
queries. You cannot delete or alter standard queries
significantly. If you want to modify an existing standard query (which
is the best way to start learning how to work with queries), you must
copy them as custom queries, and then
modify the copy. One way to copy a query is to use the Save
As Custom Query command, which is available from the Menu
button
on the query toolbar.
Another way is to use the button in
the Manage Queries window. A custom query is any query that
you create yourself. You can have any number of custom queries, and you
can change or delete them, as you like. All queries, custom or
standard, are available to be used with all Family Historian projects.
Queries are not stored in Family Historian projects - they are managed
separately.
As we have already seen, the Query Window has its own Query Toolbar. There is also a small Query Menu, which is available from the Menu
button
on the toolbar.
When constructing or modifying a query, here are some of the decisions you will need to make, and where to go to make them:
| Decision | Where Specified |
|---|---|
| What records do I want? | The Filters Tab |
| What information do I want to display about each record? | The Columns Tab |
| In what order do I want the rows to be displayed? | The Columns Tab |
| What order do I want the columns to appear in? | The Columns Tab |
| What headings do I want for each column? | The Columns Tab |
| How wide do I want each column to be? | The Result Set Tab |
If you want to print a query as a report, you also have to decide:
| Decision | Where Specified |
|---|---|
| What title(s) do I want for the printed report? | The General Tab |
| Do I want the report to appear in Portrait or Landscape mode? | The General Tab |
| If the report is too wide to fit across a single page width, what do I want to happen about the overflowing columns? | The General Tab |
The Query Window has 4 tabs:
| The General Tab | For specifying general features about the query, such as the query type, a description, print details, and so on. |
|---|---|
| The Columns Tab | Allows you to select the columns you wish to appear in the 'Result Set'. Can also specify column headings and sort order. |
| The Filters Tab | Allows you to specify which rows you wish to appear in the Result Set by creating a set of filters. |
| The Result Set Tab | A 'Result Set' is the table of data that is displayed as a result of running a query. The Result Set tab displays the result set. |