Introduction to Filtering Records |
|
Fundamentals of Filtering Records
Introduction
Data analysis consists not only of selecting records but also of setting some conditions by which the records should be presented. A condition is set as if using a funnel that decides what to let through and what to exclude. The condition or rule is also called a criterion.
A filter is a criterion or a set of criteria that must be applied to a set to create a list of records that abide by a common rule. Filters can be used to isolate records on a table, a query, a form, or a report. There are differences on the way each type of value handles a filter.
Practical Learning: Introducing Records Filtering
Filtering Records
Microsoft Access provides various techniques to filter records. To visually filter records, you can right-click the list or use buttons in the Sort & Filter section in the Home tab of the Ribbon.
When a table, a query, a form, or a report is filtered, in the Sort & Filter section of the Ribbon, the Toggle Filter button is highlighted . Also, the bottom section of the table, query, or form displays a Filtered button . If you perform another filter on the list, only the selected records would be considered. This means that you must decide whether you want the new filtering to apply to all records or only to the new ones. If you want to use all records of the list, you must first remove the previous filter.
To dismiss the previous filtering operation:
Saving Data Analysis Results
Every time you finish analyzing data, you can dismiss the result or save it. If you don't save the result, all the analysis will be lost. The best way to save the results of data analysis is by storing them in a query. Besides the ability to save sorted and/or filtered lists, queries provide advanced techniques of performing data analysis. Because they use the SQL, they use a syntax that is not directly available to tables, forms, and reports. In fact, queries provide a good alternative to creating the record source that can be used to populate a form or a report.
Introduction to Filtering by Selection
Overview
Imagine you have a list where some records share a certain value. Based on such a field, you can retrieve a list that includes only the particular string, that is, records that share that value. This is referred to as as filtering by selection.
Filtering by Selection for Equality
To get a list of all records that hold the exact same value as that of your choice, in the Datasheet View of a table, the Datasheet View of a Query, the Datasheet View of a form, the Form View of a form, the Report View or the Layout View of a report:
After clicking, the object will display only the records that share the specified in the field.
Practical Learning: Filtering for Equality
Filtering Records by Design
Another way to filter records is while you are designing a table, a query, a form or a report. In order to see the results for a table, you must first save it. If you save the table like that, the filtering feature would be included in the table.
To filter records in design, display the object in Design View. Use the Property Sheet of the table, use the bottom part of the field that will use the filter for a query, user the Record Source for the form or report.
Filtering for Un-Equal Values
To filter for records that are not equal to a certain value, in a table, a query, a form, or a report:
Practical Learning: Filtering for Un-Equal Sub-Strings
Filtering by Selection and Type
Filtering by Selection for Numbers
If the data type of the field by which you want to filter records is number-based, you can find records that use the same value or those that use different values. You can also find records that use a higher or lower value. To make your selection, right-click the value or use the Selection button of the Ribbon as we saw earlier.
Practical Learning: Filtering by Selection for Numbers
Filtering by Selection for Date/Time Values
If the data type of the field by which you want to filter records is a date or time-based, you can find records that occur:
Practical Learning: Filtering by Selection for Date/Time Values
Filtering by Selection for Boolean Values
If a field uses Yes/No values or check boxes in a form or report, you can get all records that are true (or checked) or all those that are false (or unchecked/cleared).
Practical Learning: Filtering by Selection for Boolean Values
Filtering by Selection for Null Records
If a field is missing some values, you can find records that are empty or those that contain values.
Practical Learning: Filtering by Selection for Null Records
Strings and Filtering by Selection
Introdution
If you have a set of records with a string-based column, you may want to get a list of records that share a detail inside the string, also called a sub-string. To exercise an advanced level of control on the sub-string or the combination of (sub) strings, right-click any field under the column, position the mouse on Text Filters and choose one of the options. The Custom Filter dialog box would come up. When using the Custom Filter dialog box, you can type an exact string or use some characters to create an approximate string.
Filtering by a Contained Sub-String
To filter by an exact sub-string that is contained in a string, first select the sub-string. Then:
When using the Contains option, you must first select a string or a sub-string. In some cases, you may want the string to contain one or more characters or sub-strings.
Practical Learning: Introducing Filtering by a Contained Sub-String
Filtering by an Equal Sub-String
To select records that exactly match a string, in a Datasheet View, a Form View, a Report View, or a Layout View:
Alternatively, right-click the string in the column, position te mouse on Text Filters, and click Equals... In the Custom Filter dialog box, you can type the exact string or an approximate string to look for:
Practical Learning: Filtering by an Equal Sub-String
Filtering by an Un-Equal Sub-String
To select records that have a sub-string different than the one you indicate, select a character or a sub-string in the desired column. Right-click the selected leter or sub-string. Position the mouse on Text Filters and click Does Not Equal... In the dialog box, you can type the exact or an approximate string to look for:
Filtering by a Beginning Sub-String
To select records that start with a certain letter or a sub-string of your choice, select the character or sub-string in the desired column. Right-click the selected leter or sub-string, position the mouse on Text Filters and click Begins With... In the dialog box, if you type just one character, such as c, you would get all entries that start with that character.
Here is an example:
Filtering by a Sub-String that Does Not Begin
You can right-click a cell or text box, position the mouse on Text Filters, and click Does No Begin With.... In the dialog box, you can type one or a few characters that the values in the column should not start with. This would produce the opposite results of the Begins With option.
Filtering by a Contained Sub-String
To get a list of records that contain a certain letter or sub-stirng, right-click a cell or text box in the desired column, position the mouse on Text Filters, and click Contains... In the dialog box, you can type a string or an approximation to look for:
You can also provide a list of OR characters that the string should contain. That is, you can ask Microsoft Access to find strings that contain this character, or that character, or that character, and so on. To do this, use [] and, in [], type the characters. An example would be [dgu]
This would produce all strings that include d, all strings that include g, and all strings that include u. Examples would be Arthur, Raymond, Bouba, Gabrielle, Maurice, or Orlando.
Filtering by a Sub-String that is not Contained
When filtering, you can choose to avoid records that don't contain a certain letter or sub-string. In this case, you would select Does Not Contain... when you right-click a cell or text box and position the mouse on Text Filters... In the dialog box, you can type a sub-string to look for. Any string that includes that sub-string would be excluded from the list. You can also use the square brackets to specify the characters that should not be found in some strings. For example, you can use [dgu]
In this case, the result would include all strings that don't have any of the characters in the square brackets.
Filtering by an Ending Sub-String
If you want to filter for records that end with a certain letter or string, after right-clicking a cell or text box, position the mouse on Text Filters, and click Ends With... In the dialog, you can type one or a few characters that the content of the values in the column should end with:
Here is an example:
Filtering by a Different Sub-String
To select records that don't end with a certain letter or a sub-string, right-click a cell or text box, position the mouse on Text Filters, and click Does No End With...
Practical Learning: Ending the Lesson
|
||
Previous | Copyright © 2000-2022, FunctionX, Inc. | Next |
|