Query Window

Query Window: Columns Tab


Query Window: Columns Tab


This tab allows you to specify the columns that you wish to see displayed in the result set. Columns typically display the value of a field (like Birth Date say); but they can also display the value returned by a function (more on this later). The list of possible fields (given the record type of the Query) are displayed in the Fields List on the left-hand side. Select one of these, and click the > button (or just double-click on it) to add the field to the Columns List (on the right-hand side). See below for more information.

Components of the Columns Tab - the Left-Hand Side

The Fields List

Displays all the possible fields (given the record type of the Query). Click on the expansion button (boxes with a '+' or '-' in them) to show or hide field ‘branches’ (sub- fields). Some fields are grouped into categories (represented by folder icons).

Select a field in the Fields List and click on the button to the right of it > to add it to the Columns List.

The Fields List Information Panel This panel, which appears immediately below the Fields List, displays information about the item selected in the Fields List.
Displays the Fields List Dropdown Menu - see below.

 

The Fields List Dropdown Menu

Show Linked Records in List Show (or hide) linked records.  For example, if viewing fields for an Individual record and you expand the 'Family as Child' field to view its subfields, do you want to see Family record fields here too?
Show Qualifiers in List Show (or hide) field qualifiers.  For example, when you expand a date field, do you want to see a list of qualifiers (:DAY, :DAY_OF_WEEK, :MONTH_NUMBER, etc) which can be used with dates?
Show Description in Box Do you wish to see a description of the currently selected field, in the box below the Field List?
Show Data Reference in Box ... or would you rather see the data reference that can be used to reference this field?
Show Both in Box ... or would you like to see both?

 

Components of the Columns Tab - the Right-Hand Side

The Columns List

The Columns List lists the columns that will appear in your result set when you run the query (except that you can have hidden columns - these are described in more detail below).

The Columns List itself has four columns . These are:

  • Heading
  • Expression
  • Sort
  • Hidden

You can resize columns in the Column List by clicking on the line between the column headings, and dragging left or right.

Heading This is the text that will appear as a column heading in the result set when you run the query, or in your printed report, if you print it. If you add an entry to the list by inserting it from the Fields List on the left-hand side of the window, a default heading will be supplied, as well as an expression. You will almost certainly want to change the default heading, to make it more meaningful. You may also want to edit the expression.
Expression The expression represents the data that you wish to appear in the result set column. There are 2 kinds of expressions that can be used:
  • Data References - which identify fields.
  • Functions - which compute values

You can write your own data references if you want to, but it's easier to let Family Historian do it for you. To do that, simply select the field you want from the Fields List on the left- hand side of the window, and click > to insert it as a column. Advanced and technically-minded users may wish to look at Understanding Data References for more information on data references.

If you wish to use functions, it is usually easiest to find a sample query that uses the function you want, and copy the relevant expression from that query.

Tip A quick way to copy text is to select it and press Ctrl-C. Ctrl-V can then be used to paste it where you want it. These key-combinations work in the vast majority of windows and dialog boxes in Windows.

Advanced and technically-minded users who wish to understand more about how to use functions, should see Understanding Functions for more information.

Sort You can sort on as many columns as you wish - either ascending or descending. See next paragraph for more information.
Type The possible column types are:
  • Normal
  • Hidden
  • Buddy

Hidden columns do not appear in the result set, or in printed reports. You rarely need to make columns hidden, but it is occasionally useful, as a way of getting the exact kind of sort you want. Family Historian will always apply sorts in column order precedence, from left-to-right. If you need to create a query in which the order of precedence of sorts, does not match the display order of the result set columns, you can do it by making all the sort columns hidden, and ordering them however you like. Then add all the visible columns you need, in the display order you want, including duplicate columns (i.e. duplicates of a hidden column) where necessary.

Buddy columns are also hidden and also do not appear in the Result Set, or in printed reports.  They are used as a means to associate a cell with a data item (to make it 'data-linked') so that if the user double-clicks on the cell, or right-clicks on it to view a context menu, he or she will be able to view the underlying data item in the Property Box.  Buddy columns provide the data-linking for the immediately preceding column in the query.  In order for a buddy column to have any effect, it must contain a data-reference or an expression which returns a reference to a data item.  It must have an immediately preceding column, and that column must not itself be hidden or a buddy column, and it must not contain a data-reference or an expression which returns a reference to a data item.  See the "Individual Timeline" query for an example of a query that uses a buddy column.

A Normal column is any column that isn't either hidden or a buddy column.

Deletes the currently selected row(s) in the Columns List.
For re-ordering rows in the column list. Moves the selected row up one.
For re-ordering rows in the column list. Moves the selected row down one.
Add Click on this button to add a new entry to the list (i.e. to add a new column to the result set), using the values supplied in the 4 boxes (heading, expression, sort and hidden). The new entry will be added to the bottom of the list, but you can re-order the list if you wish to using the arrow buttons. If the data in the Expression field is not a valid expression (i.e. a data reference or a function), the add will fail.
Update Click on this button to update the selected entry in the list with the current values in the Heading, Expression, Sort and Hidden fields. If the data in the Expression field is not a valid expression (i.e. a data reference or a function), the updategloss will fail.
Disabling and Re-Enabling Columns

You can disable any column in a custom query by right-clicking on it, and selecting Disable from the dropdown menu that appears.  The line will then display with greyed text, to show that it is disabled.  To re-enable it, right-click on it again, and select Enable from the dropdown menu that appears.