Introduction to Data Analysis |
|
|
For this reason, you can sort records on a field, not
because you want to get the alphabetical order, but because you would like
to find out what record(s) need(s) to be completed. This could be used to find
out what student doesn't have an e-mail address yet. |
Practical Learning: Sorting Records on Tables
|
Record Sorting on Forms |
When reviewing forms, we saw that a form can display in Datasheet View, like a table or a query. With that type of form, you can apply the same techniques we used to sort records on a table. If you display a form in its regular and most usual format, where it displays one record at a time, you can still perform the same sorting operations as done on a table. This allows you to view one record at a time. |
Practical Learning: Sorting Records on Forms
|
Record Filtering on Datasheet and Form Views |
Introduction |
So far, we have built fairly simple queries that consisted of displaying all records that are part of a table. The only thing we were doing was to select the necessary fields. In some circumstances, you may want to set a limit on the number of records to display or make available to the user. To do this, you must create a rule and ask Microsoft Access to apply it to a set of records (also called a Recordset). The rule works like a funnel that decides what to let through and what to retain. The rule is also called a criterion. For example, you can set a criterion that asks a query to consider the list of all students in a school but to restrict the list only to female students. |
A filter is a criterion or a set of criteria that must be applied to a Recordset 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 it. |
Records Filtering Using Selections |
While sorting is used to rearrange data in
alphabetical, incremental, or decremental orders, filtering allows you to isolate data. For example, when you order the Gender column alphabetically, you get a list of girls first (F for Female), then the boys (M for Male). Using a filter, you can create a list that would include only one of these categories. Imagine you want to have a list of only movies that are rated R. To do that, you can click an R field and filter by selection: |
Unlike the sorting techniques, filtering hides data.
In order to execute another filter on all records, you must remove the previous filter, unless, as we will see shortly, you want to combine filters. The context menu provides the same options available on the toolbar. |
Practical Learning: Filtering Data By Selection
|
Filter By Exclusion |
Instead of using a field's content as a basis for inclusion, you can ask the table to deny or hide the records that respond to a certain field. This is referred to as filtering by exclusion. In Microsoft Access, this is done using Filter Excluding Selection. Imagine that, on your Videos table, you want to get a list of movies that are not rated R, you can right-click an R field in the Rating column and click Filter Excluding Selection. |
Practical Learning: Filtering Records By Exclusion
|
Filter By Form |
|
The techniques we have used so far to analyze our data consisted of looking for a particular field content as a basis for our filtering. Microsoft Access provides another technique that allows you to select a criterion from an empty field. Using this technique, the whole table is emptied and all records get hidden. You can then select your criterion from the column of your choice. Although the fields appear empty, each column equips its first and only field with a combo box that displays a list of all records of that column, thereby allowing you to select, which one of the fields responds to your choice. This technique is referred to as Filter By Form. |
Practical Learning: Filtering By Form
|
Data Analysis With Operators |
Introduction |
Queries are meant to provide advanced techniques of performing data analysis. Because they use the SQL, they use a syntax that is not directly available to tables and reports. In fact, queries provide a good alternative to creating the record sources that can be used to populate forms and reports. To make this effective, it is a good idea to know what the SQL has to offer. To perform data analysis, besides the techniques of selection, exclusion, and form we have used so far, you can use operators. We have already reviewed some of the operators used |
throughout Microsoft Access. Such operators can also be used when filtering records. Besides those, the SQL provides additional operators to further filter data. To provide a more refined criterion to filter data, the table and form can present a special text available from right-clicking the object. This is presented as Filter For. When the text box displays, you can use operators to write an expression and apply it as the criterion. |
Advanced Filter By Selection |
All of the techniques we used to filter data by selection, exclusion, and form on tables are also available on queries. As done on tables and forms, such criteria do not get saved. This is used to preserve data even if a filter was previously applied to an object. If you want to create a list that permanently reduces the number of records available, you can use a query. Based on its structure, a query uses operators to filter data and saves the criteria. To create a query to filter records by selection, you should open it in Design View and use Criteria field to write the expression that will be applied. To write an expression that would be used as the criterion of data filtering on a Datasheet View of a table or a query or the Form View of a form, right-click the object. Then, in the Filter For text box, type the expression and press Enter. There are a few rules you should observe:
Of course, there are situations in which these rules can or must be applied differently. When in case, you will be appropriately directly. |
Practical Learning: Filtering For
|
Data Analysis and Filtering by Comparison |
Databases and other programming environments provide operators you can use to perform data analysis. We have already reviewed the logical operators used because they apply to other scenarios. These operators can also be very valuable for data analysis and/or filtering. Comparisons are performed on Boolean, numbers, date, time, or string fields or values. To perform a comparison on a Boolean field, you can right-click it, click Filter For and type the desired value as True or as False. After pressing Enter, the database would perform the comparison and display the result. When comparing date-based or time-based values, include the date or time value between two # signs. For example, to get a list of records that occur before 1/1/1950, you would type an expression such as <=#1/1/1950# |
Practical Learning: Performing Comparisons
|
MOUS Topics |
S27 | Sort records |
S28 | Apply and remove filters (filter by form and filter by selection) |
S29 | Specify criteria in a query |
Exercises |
Yugo National Bank
|
Watts A Loan
|
|
||
Previous | Copyright © 2002-2015 FunctionX | Next |
|