Difference between revisions of "Filter"

From Gramps
Jump to: navigation, search
m (How to define custom filters: View versus View Mode confusion on my part)
m (add-on > addon ( stick with one spelling ))
 
(31 intermediate revisions by 6 users not shown)
Line 1: Line 1:
What are filters?
+
{{languages|Filter}}
{{languages}}
+
 
[[Category:Documentation]]
+
What are filters? They are a way to tell a database to only display records that have particular attributes. Filters can do the opposite too and hide records with particular attributes. Filters don't change or delete records, they just temporarily hide them.
 +
 
 +
Filtering genealogical information is crucial for research, as well as for removing the clutter of irrelevant data from reports.
  
==Filters==
+
Most reports of Gramps allow the use of filters, only displaying information about people that correspond to the filter.  
Filtering genealogical information is crucial for research, as well as for creating nice reports.
 
Most reports of GRAMPS allow the use of filters, only displaying information about people that correspond to the filter.  
 
  
On the other hand, filtered data can be all the info you need, like a self constructed mini-report.
+
On the other hand, filtered View data can be all the info you need, like a self constructed mini-report.
  
 
==How to define custom filters==
 
==How to define custom filters==
Custom filters are relative to the active View. If you are in People View you will create a Person Filter, Event View/an Event Filter, etc. In the {{man label|Edit}} menu, click the option {{man label|<View> Filter Editor}}.
+
Custom filters are specific to the active [[Gramps_Glossary#category|Category]] View. If displaying the People Category View, you will create a Person Filter; Event Category View, an Event Filter; et cetera.  
  
You can give the custom filter a name and add rules to the filter. The data will be filtered according to the rules.  
+
Select the {{man menu|Edit &#x27a1; ''<Category>'' Filter Editor}} menu option and from the {{man label|''<Category>'' Filters}} dialog select {{man label|Add a new filter}} to bring up the {{man label|Define filter}} dialog.
  
In some filters you can use regular expressions. For learning how to use regular expressions, see the  [http://www.amk.ca/python/howto/regex/regex.html Regular Expression HOWTO].
+
From the {{man label|Define filter}} dialog you can give the custom filter a name and add ([[Gramps_{{man version}}_Wiki_Manual_-_Filters#Which_filter_rules_in_which_Category.3F|built-in]] or
 +
[[Rule_expansions|addon]]) rules to the filter. The data will be filtered according to the rules.
 +
 
 +
In some filters you can use regular expressions. For learning how to use regular expressions, see the  [https://docs.python.org/howto/regex.html Regular Expression HOWTO].
  
 
== Test a custom filter==
 
== Test a custom filter==
In the {{man label|Edit}} menu, click on {{man label|Column Editor}}, and select the columns you want to view. Next, activate {{man label|Filter}}. This can be done by going to the {{man label|View}} menu, and clicking on {{man label|Filter}}.
+
[[File:FilterTest-results-for-TestTheSelectedFilter-button-example-50.png|right|thumb|450px|Fig. {{#var:chapter}}.{{#vardefineecho:figure|{{#expr:{{#var:figure}}+1}}}} Filter Test - results list example from Person Filters]]From the {{man label|<Category> Filters}} dialog list select the previously created custom filter and select the {{man button|Test the selected filter}} button to show the {{man label|Filter Test}} dialog that will show the results if any.
  
 
== Examples ==
 
== Examples ==
 
See [[Example filters]].
 
See [[Example filters]].
To the right of the list view, a sidebar will open, allowing to filter your data. At the bottom of this, you can select the newly created Custom Filter. Click on Find, and all Persons/ Families/Events/Places/Media/Repositories matching the filter are displayed.
 
At present (version 2.X), there is no way to print this data.
 
  
In the '''3.0 version''' you will have an option {{man label|Export view}} on the {{man label|Family Trees}} menu. This gives you the opportunity to export the view as a spreadsheet with following format options:
+
To the right of the list view, a sidebar will open, allowing to filter your data. At the bottom of this, you can select the newly created Custom Filter. Click on {{man button|Find}}, and all Persons/Families/Events/Places/Media/Sources/Citations/Repositories/Notes matching the filter are displayed.
*[[Gramps_3.0_Wiki_Manual_-_Manage_Family_Trees:_CSV_Import_and_Export#Export|CSV]]
+
 
 +
==Other options==
 +
You have an option {{man label|Export view}} on the {{man label|Family Trees}} menu. This gives you the opportunity to export the view as a spreadsheet with following format options:
 +
*[[Gramps_{{Version manual}}_Wiki_Manual_-_Manage_Family_Trees:_CSV_Import_and_Export#Export|CSV]]
 
*Open Document Spreadsheet
 
*Open Document Spreadsheet
  
Another '''3.0''' method would be that you select the {{man label|Export}} option on the {{man label|Family Trees}} menu. An '''Export Assistant''' view will be presented where you also can select the {{man button|Comma Separated Values Spreadsheet (CSV)}}. Next, click on the {{man button|Forward}} button and in the next screen you can select in the {{man label|Options}} view which filter you want to use and whether you want to include Indivuduals, Marriages and Children. Click once again on the {{man button|Forward}} button and you can save the file.
+
Another method would be that you select the {{man label|Export}} option on the {{man label|Family Trees}} menu. An '''Export Assistant''' view will be presented where you also can select the {{man label|Comma Separated Values Spreadsheet (CSV)}}. Next, click on the {{man button|Forward}} button and in the next screen you can select in the {{man label|Options}} view which filter you want to use and whether you want to include Individuals, Marriages and Children. Click once again on the {{man button|Forward}} button and you can save the file.
  
 
== Suggestions for filter rules==
 
== Suggestions for filter rules==
What you can do with a filter depends on the rules available to you in GRAMPS.
+
What you can do with a filter depends on the rules available to you in Gramps.
If you have a suggestion for a new usefull filter rule, do a [[How to report bugs|feature request]].
+
 
 +
Any suggestions for a new useful filter rule, please create a [[Using the bug tracker|feature request]].
 +
 
 +
== See also ==
 +
* [[Gramps_{{Version manual}}_Wiki_Manual_-_Filters|Gramps Manual - Filters introduction]]
 +
* [[Example_filters|Example filters]]
 +
* [[Rule_expansions|Addon Rules]] functional documentation
 +
* [[{{Version manual}}_Addons#Addon_List|Addons]] list (sort on type. Search for ''Rules'')
 +
 
 +
[[Category:Documentation]]
 +
[[Category:How do I...]]
 +
[[Category:Filters]]

Latest revision as of 00:37, 29 March 2022

What are filters? They are a way to tell a database to only display records that have particular attributes. Filters can do the opposite too and hide records with particular attributes. Filters don't change or delete records, they just temporarily hide them.

Filtering genealogical information is crucial for research, as well as for removing the clutter of irrelevant data from reports.

Most reports of Gramps allow the use of filters, only displaying information about people that correspond to the filter.

On the other hand, filtered View data can be all the info you need, like a self constructed mini-report.

How to define custom filters

Custom filters are specific to the active Category View. If displaying the People Category View, you will create a Person Filter; Event Category View, an Event Filter; et cetera.

Select the Edit ➡ <Category> Filter Editor menu option and from the <Category> Filters dialog select Add a new filter to bring up the Define filter dialog.

From the Define filter dialog you can give the custom filter a name and add (built-in or addon) rules to the filter. The data will be filtered according to the rules.

In some filters you can use regular expressions. For learning how to use regular expressions, see the Regular Expression HOWTO.

Test a custom filter

Fig. .1 Filter Test - results list example from Person Filters

From the <Category> Filters dialog list select the previously created custom filter and select the Test the selected filter button to show the Filter Test dialog that will show the results if any.

Examples

See Example filters.

To the right of the list view, a sidebar will open, allowing to filter your data. At the bottom of this, you can select the newly created Custom Filter. Click on Find, and all Persons/Families/Events/Places/Media/Sources/Citations/Repositories/Notes matching the filter are displayed.

Other options

You have an option Export view on the Family Trees menu. This gives you the opportunity to export the view as a spreadsheet with following format options:

  • CSV
  • Open Document Spreadsheet

Another method would be that you select the Export option on the Family Trees menu. An Export Assistant view will be presented where you also can select the Comma Separated Values Spreadsheet (CSV). Next, click on the Forward button and in the next screen you can select in the Options view which filter you want to use and whether you want to include Individuals, Marriages and Children. Click once again on the Forward button and you can save the file.

Suggestions for filter rules

What you can do with a filter depends on the rules available to you in Gramps.

Any suggestions for a new useful filter rule, please create a feature request.

See also