Filters

Reports in TMG are based primarily on which person or persons are to be included in the report.  This specification is made in theReport Definition Screen. In most cases, you have one or more of the following choices:

Prompt When Generated All People All Tag Types
Person Number All Places All Tasks
All Citations All Repositories Filtered Group
All Events All Sources

Most of these are rather easy to understand, so we won't dwell on them. But many people have a problem understanding the Filtered Group option. Filters are used when you don't want one person (the first two options) and one of the "All" options doesn't satisfy your needs. In other words, you want the report to include only those records in a certain group. So you define a filter based on certain questions. But how do you create the filter so that it defines the group that you want?.

The first step is to define the group to yourself in terms that you can easily understand. Something like:

  1. "all persons with a surname of Jones born before 1900" or
  2. "all my three great grandfather's descendants and their spouses" or
  3. "all my maternal grandfather’s direct ancestors" or
  4. "all my earliest ancestors".

Once you have defined the group you want, then you can start creating the filter.

Before we start, let's look at what makes up a filter. The filter is entered in essentially five columns of option buttons and one data or value field column. These columns and the data field column are arranged in eight lines. Therefore, a filter will consist of from one to eight lines with each line having four to six parts. Basically, each filter line will be a simple query to be answered by the criteria listed on the line. The filters are created by clicking on the buttons and selecting options from the menus.

Note that there if you have three or more filter lines and the right-hand column has both AND and OR selected then two added one character fields columns are available. These are the left and right parentheses. Each button selects the specific (left or right) parenthesis mark or turns it off. The parentheses allow you to group lines so that some lines are used together and other lines are kept separate. We'll talk more about these parentheses fields later. 

Another single character column is available in v5x and v6x between the left parenthisis column and the Filed column.  When this is selected, the filter Field option chosen is considered as only Primary data.  In v4x and earlier, this is part of the selected filter Field option includes this designator as part of the option..

The column of buttons next to the left parenthesis column is entitled "Field" and will contain the subject of the filter line's question. This would be something like "Person Number", "Is a Descendant of", "Source Number", "Tag Type label", "Any Birth Date Year", etc. Clicking on a button in this column will display a menu of options with the appropriate options for the report. Depending on your option selection from this menu, a second option menu may appear, which selection may cause a third option menu to appear.

The adjoining column of buttons is the Operator. It is like the verb of the question. It might be "Equals", "Is Greater Than", "Contains", "Tag Exists", etc. Like the Field buttons, clicking on an Operator button will cause an option menu to appear with the appropriate selections available.

The next column would be where you would enter the data for which you want to search. For some operators (e.g., "Exists", "Is Empty", etc.), this will be blank. For the rest, this will tell TMG exactly what you want to find.

The right-most column is the connector and is used to tie the filter lines together or to signal that there are no more filter lines. There are three possible Connect values: "And", "Or", and "End". The "Or" connector means that any data satisfying either the preceding filter line or the succeeding filter line or both lines would be selected for the report. The "And" connector means that only the data satisfying both the preceding and succeeding filter lines would be included in the report.

With the filter lines being connected by "And" and "Or" connectors, we want some way to tell TMG that certain lines are to be grouped and others are not. For example, you may want your two of your great grandfathers (assume one from your maternal line and one in your paternal) and their descendants that are your direct ancestors. This would mean that there would be six persons in the final list: both great grandfathers, both grandfathers, and your parents. You might create a filter like:

Is an Ancestor of Person Number   1 AND -- You
ID Number Equals 83 OR -- A great grandfather
Is a Descendant of Person Number 83 OR
ID number Equals   4 OR -- A great grandfather
Is a Descendant of Person Number   4 END

As this stands, TMG would come up with some rather odd results. But, if we add parentheses appropriately, the the filter becomes:

Is an Ancestor of Person Number   1 AND -- You
( ID Number Equals 83 OR  -- A great grandfather
Is a Descendant of Person Number 83 OR
ID number Equals   4 OR -- A great grandfather
Is a Descendant of Person Number   4 ) END

The result is as we wished - six persons -- the two great grandfathers, the grandfathers, and the parents. So you see that grouping of filter lines will help us get what we want. Now let’s define some filters that fit the example definitions above.

Sample Filter #1. The first one is a fairly simple one and we don’t need to be concerned with the parentheses, so we will ignore those for now. Basically we want all persons named JONES only if they were born before 1900. Looking at the definition, we can break it down into two parts: "all persons named JONES" and "if they were born before 1900". This means that we will have a two line entry filter.

For the first line, we need to define the Field entry. Depending on the report that you are planning to run, the Field selections will vary. But for now, let’s work with the List of People (LOP) report. Select the filter Group option of the Focus tab and click on the top Field button. This displays the Filter Options menu window. You need to decide if you want to work with all tags or just the Primary tags. Then you would select either: Any (Tag...) or Any Primary (Tag...). We’ll assume all tags which will include married names as well as nicknames, etc., so we pick the Any (Tag...) option. This then displays the next Filter Options window. Now select one of the Name selections. If you want to select data from any Name tag then you want the Name Group option, which is what we’ll select. TMG now displays the third Field Options window from which we select the Surname option. This closes the options window and show the new Field entry: Any Name Group Surname.

We now click on the adjacent Operator button and select the Equals option. Then, in the adjacent Value field, we may place the surname of interest (JONES in this case). It is usually best if you enter the value "[?]" (no quotes) instead. When you place "[?]" in the value field, then you are allowing TMG to ask you when you generate the report for the surname. This way you can use the same Report Definition many times for many surname (in this case) without changing the filter. Click on the adjacent Connect button and select the AND option. We’ll discuss the reason for this in a minute.

Click on the Field button on the second line, and select the Any Primary (Tag...) option (you could select the Any (Tag..) option if you want to also consider non-Primary Birth tags). Now select the Birth option from the next Field options windows (you may wish the Birth Group or another tag in the Birth group). Finally, select the Date - Year option for the next Field Options window. This puts the filter field of: Any *Birth Date - Year in the line. Now select the Is Less Than option for the Operator and enter "[?]" in the Value field.  You could enter 1900, but again the "[?]" variable allows the Report Definition to be used over and over for different search values without having to modify the Report Definition. In the adjacent Connect column, select the END option since this is the last line.

Now, let’s discuss the Connect option that we chose for the first line. Because we want only the JONES persons born before 1900, the person must pass both filters in order to be selected. Thus we chose the AND option which gives a filter something like:

Any Name Group Surname Equals [?] AND
Any *Birth Date - Year Is Less Than [?]  END.

Note that the above is for v4x.  For later versions, the asterisk in the second line is in a column by itself as noted above. This also applies to examples below having the asterisk in the Field text.

Now if the example definition had been:
        "All persons with a surname of JONES or SMITH who were born before 1900,"
then we would have to use the Parentheses to achieve the desired results and we would have three filter considerations: "all persons named JONES", "all persons named SMITH", and "persons born before 1900". This indicates that we would have three filter lines. So, in addition to the two lines we already defined, we would want another line much like our first. So we would have a filter something like this:

Any Name Group Surname Equals [?] AND
Any Name Group Surname Equals [?] AND
Any *Birth Date - Year Is Less Than [?] END.

The problem here is that we would only get those women who were SMITHs with married (or some other variation) names of JONES or who were JONES with married (or some other variation) names of SMITH. Now what we want are all JONES born before 1900 AND all SMITHs who were born before 1900. Now we could create a filter like:

Any Name Group Surname Equals [?] AND
Any *Birth Date - Year Is Less Than [?] OR
Any Name Group Surname Equals [?] AND
Any *Birth Date - Year Is Less Than [?] END.

This groups the filter into two sections using the OR Connect.  We could use parentheses to explicitly group the sections like:

   ( Any Name Group Surname Equals [?] AND
Any *Birth Date - Year Is Less Than [?]   ) OR
   ( Any Name Group Surname Equals [?]   AND
Any *Birth Date - Year Is Less Than [?]   ) END.

But due to the arrangements of the ORs and ANDs, it is unnecessary.  However, if it makes it easier for you to write and understand, go ahead as it doesn't hurt.

Either filter would give us what we want, but both are somewhat redundant and thus would take longer to generate the report.  The difference in time depending on the size of your dataset may not be all that much.  But if you get used to trying to write more efficient filters now, then when you have a large dataset, then it will easier to write the more efficient filters. I the above cases, we only need to consider the date filter line once, so let’s go back to the three-line filter. If we group the first two lines and accept results from either line, then the filter would look like this:

   ( Any Name Group Surname Equals [?] OR
Any Name Group Surname Equals [?]   ) AND
Any *Birth Date - Year Is Less Than [?] END.

This is shorter, more efficient, and gives us what we want.

Sample Filter #2. This example shows what you need to do when you can’t quite achieve the result you want in a single filter. There are times when you select certain persons and then add others or even select a subset of the first group. This example is a multi-step operation. First we determine our direct ancestors, selecting only those back to our three great grandfather. Second, we add their descendants. Finally, we include the spouses of all those selected.

For step one, we would create a LOP report with a filter as follows:

ID Number Equals [?] END
[X] Ancestor(s)  _5_ generations

This would select the ancestors of the person whose ID# we enter as the report is generated. We will probably send this report to the screen and review the results. If the results give more or less than we want we should reduce or increase the number of generations. When the results are what we want, the we would run the report a final time using the Secondary tab Change Flag option to set a flag to a particular setting. I’ll assume that we have created a custom Flag called INTERIM with settings of N(o) & Y(es) and N(o) being the default. So we’d generate the report using the Secondary Output to set the INTERIM Flag to Y for all the persons selected by the filter. This should be our three great grandparents, our two great grandparents, our great grandparents, our grandparent, and our parents.

For step two, we would generate another LOP report using a filter based on the resullts of the first report. The filter in this report would be something like:

INTERIM Flag Equals Y END
[X] Descendant(s)   _250_  generations

Again, we would send the results of this report to the screen for review to ensure that it includes the persons that we want. When the results are as we desire, we would generate the report as final time. This time, we would also make use of the Secondary Output tab the Change Flag option to again set the INTERIM Flags to Y for those selected. This should be those that were selected in the first report and all their descendants which would include siblings and cousins of all persons descended from our three great grandparents.

Finally, we would generate the report that we intended all along and again we would use the INTERIM Flag to help us select those we want. The filter would be like this:

INTERIM Flag Equals Y END
X] Spouse(s)

The results of all this would be a minimum of 128 persons which are our direct ancestors plus ourself and our spouse. Our children, siblings, cousins, aunts/uncles, etc. would increase the total number and would vary according to what data has been researched and entered for each family.

Sample Filter #3. There are similarities here to the example we just studied. This time we don’t limit the number of generations and we start with our mother, selecting her father as the starting point. This time, we would only have to run the one report.

We would create a LOP report with a filter as follows:

ID Number Equals [?] END
[X] Ancestor(s)    _250_  generations.

This would select the persons we want if we enter our maternal grandfater’s ID# when we generate the report.

Sample Filter #4. This is a report that many users find themselves wanting at some point. We want only those persons who are our direct ancestors and then only those who we have not been able to identify their parents. This might include a great grandmother as well as a 14th great grandfather as well as other ancestors (men or women) in different lines.

The filter would be something like:

Is an Ancestor of Person Number [?] AND
Father ID# Equals 0 AND
Mother ID# Equals 0 END

This should give us the results we need. Remember that we may know a specific three great grandfather, but not know his spouse that was our three great grandmother. And we may know a five great grandmother and not know her spouse, our five great grandfather. Some lines of our ancestors we are able to find and identify while other lines we run into those brick walls. This report would show those brick wall ancestors.

While I have not covered all possible filters, I have touched on the various aspects of writing filters. So you should be able to develop the filters that you need based on these ideas.


Return to the TMG Tutorials page

Last revised:

Hit Counter