In this video, we're going to talk about sorting and filtering. And these are both tools that
you can use to organize your data. They're really useful when you're working with tables, but
you can use it with other objects as well.
By default, tables are sorted by the ID number, but you can sort by any field that you want.
First, click on the field name, and then on the Home tab, click Ascending or Descending.
All of the records are now in alphabetical order by last name, making it much easier
to find a specific customer. And if you want to clear the sort, then you can click Remove
Sort in the Home tab.
Now sometimes when you have a lot of data, it's easier to just hide the records that
you don't want, and you can do that by creating a filter. There are several different ways
that we can filter the data. If you click the drop-down arrow next to the field name,
you'll see a list of all of the different values that appear in this field. And each
one will have a checkbox next to it. So you can uncheck the ones that you don't want to
see. If you uncheck Select All, it will clear all of them. And I just want to see the customers
from Cary.
The drop-down arrow will turn into a filter icon to show that there is a filter on this
field. Once you've created a filter, you can turn it off and on by clicking Toggle Filter
on the Home tab.
I'm going to open the Products table. And I want to filter based on the product name,
but here I'd like to show all of the products that contain the word chocolate in the name.
To do this, I'll select the word chocolate, and then in the Home tab click Selection,
and you'll have several different options. I'm going to select Contains Chocolate. And
now you can see that all of these contain the word chocolate somewhere in the product
name.
And just like before, you can click Toggle Filter to get rid of it.
Filtering by Selection worked well here because we could just select the word 'chocolate'
in this first record. But let's say I want to look for products that contain the word
'butter'. I don't see any of them here that I could select, and I don't really want to
scroll through all of the records looking for that word. So instead, I'm going to apply
a text filter. Click the drop-down arrow and go to Text Filters. And we're looking for
something that *contains* the word 'butter'. Then you can just type what you're looking
for here, and click OK. And this filter gives us results like peanut butter, butter pecan,
and butterscotch.
Now if you're working with a field that just has numbers, then you can apply a Number Filter.
I'm going to open the Menu Items table. And I'd like to know *how many* of our products
cost 30 dollars or more. Click the drop-down arrow, and then go to Number Filters. And
choose Greater Than, and then we'll type 30.
Then we could count the number of records here, or we can just look at the Record Navigation
bar. So we have 13 different products that cost 30 dollars or more.
And finally, with fields that contain dates, you can apply a Date Filter. I'm going to
go to the Orders table. You can click the drop-down arrow and select Date Filters. And
you'll have a lot of different options, such as This Week, Last Week, or Next Month, or
if you want to look at a specific month, you can go to All Dates In Period and select the
month that you want.
Experiment with the different Sorting and Filtering options, and keep in mind that you
can always remove the sort or the filter to view all of the data.