The Basics of Defining a Filter with the Filter Builder

When you first access the Filter page, the Filter Builder is selected by default and there is an entry area for a Filter Condition Set. A Filter Condition Set is a set of one or more filter criteria, with each criteria comprised of a column, an expression, and a value.

Title: Filter Builder Fields - Description: Filter Builder Fields

Each Filter Condition Set can be comprised of one or more criteria, with an “And” or “Or” connector implied between each of the criteria. Each criteria is comprised of a column, an expression, and a value.

The Filter Builder is made up of the following parts:

      Edit Manually: Disabled by default, enable this options if you are comfortable building CAML-based queries.

      And/Or: Set to And by default, this option is used when there is more than one condition being filtered upon within the group.  The And indicates that all of the filtering conditions must be met, while the Or indicates that at least one of the filtering conditions must be met.

      Add Condition: Click this button to add a new condition to the filter.

      Add Group: Click this button to add a new group to the filter with its own conditions.

      Delete Group: Click this button to remove the selected filter group.

      Choose Column: This drop-down menu has all of the columns for the select list/library.  Choose one to apply a filter against.

      Choose Filter Operator: This drop-down menu contains filtering operations for the filter.  These options are:
 

Table 11: Filtering Operators

Operator

Meaning

Begins with

Includes all items that begin with the provided characters.

Contains

Includes all items that contain the provided characters in the order provided.

Equals

Includes items with a value that exactly matches the value provided in this filter.

Greater than

Includes all items with a value that comes after the provided value sequentially in a numeric or alphabetical list.

Greater than or equal to

Includes all items with a value that comes after the provided value sequentially in a numeric or alphabetical list, and any items that match the provided value.

Less than

Includes all items with a value that comes before the provided value sequentially in a numeric or alphabetical list.

Less than or equal to

Includes all items with a value that comes before the provided value sequentially in a numeric or alphabetical list, and any items that match the provided value.

Not equal to

Excludes all items that match the provided value.

Is null

Includes all items with an empty or unassigned value in the specified field.

Is not null

Includes all items that have an assigned value in the specified field.

 

      Filter Value: Blank by default, enter in the value the column is being filtered for/against.  If the Filter Operator is use “Is Null” or “Is Not Null” this field can be left blank.

      Delete Condition: Click to delete the condition.

 

To define a filter:

1.     If the condition set is only going to contain a single condition, you can ignore the And/Or drop-down, which default to “And.” If the condition is going to contain multiple conditions, select “And” or “Or” from the drop-down to specify whether all of the conditions have to be met (And) or just one of them (Or). You cannot mix “And” and “Or” conditions within a single condition set.

2.     Click on the Add Condition button (Title: Add Condition Icon - Description: Add Condition Icon) to add a row for creating a new filter.

3.     The first drop-down (Choose Column) is the  on the next line presents a list of all of the columns that are available for filtering. These are the columns from the list you identified on the Columns page. Click to select the column you want to start building your filter with.

4.     The next drop-down (Filter Operator) is used to select the desired expression for the filter.

5.     The third drop-down (Filter Value) is used to identify the value you want the filter to find. You can simply type in the value you want to find, or you can use the [ME] function to filter on the currently logged in user.

Filtering on Date Columns

If the filter is being built based on a date column, any of the functions listed in the table below can also be used.

Table 12: Functions For Filtering On Date Columns

Function

Meaning

2

Two days from today’s date (i.e. – today plus 48 hours)

1

One day from today’s date (i.e. – today plus 24 hours)

-1

One day before today’s date (i.e. – today minus 24 hours)

-2

Two days before today’s date (i.e. – today minus 48 hours)

[Today]

Today's date

[CurrentWeekStart]

Sunday of the current week

[CurrentWeekEnd]

Saturday of the current week

[CurrentMonthStart]

The first day in the current month

[CurrentMonthEnd]

The last day in the current month

[CurrentYearStart]

The first day in the current year

[CurrentYearEnd]

The last day in the current year

[Quarter1Start]

The first day in the first quarter (January 1) of the current year

[Quarter1End]

The last day in the first quarter (March 31) of the current year

[Quarter2Start]

The first day in the second quarter (April 1) of the current year

[Quarter2End]

The last day in the second quarter (June 30) of the current year

[Quarter3Start]

The first day in the third quarter (July 1) of the current year

[Quarter3End]

The last day in the third quarter (September 30) of the current year

[Quarter4Start]

The first day in the fourth quarter (October 1) of the current year

[Quarter4End]

The last day in the fourth quarter (December 31) of the current year

[OneWeekAgoStart]

Sunday of the previous week

[OneWeekAgoEnd]

Saturday of the previous week

[TwoWeeksAgoStart]

Sunday of the week before last

[TwoWeeksAgoEnd]

Saturday of the week before last

[OneWeekFromNowStart]

Sunday of next week

[OneWeekFromNowEnd]

Saturday of next week

[TwoWeeksFromNowStart]

Sunday of the week after next

[TwoWeeksFromNowEnd]

Saturday of the week after next

[OneMonthAgoStart]

The first day of last month

[OneMonthAgoEnd]

The last day of last month

[OneMonthFromNowStart]

The first day of next month

[OneMonthFromNowEnd]

The last day of next month

NOTE: Using Date Functions

    The date functions are all relative to the current date.

    If you do not define an ending date or function, the Data Display will return all items that meet the filter criteria from the defined date function going forward.
 
For example, say you define a filter that looks for a Due Date greater than or equal to [Quarter1Start] and do not define an ending date. The Data Display will return all items that have a due date from the start of this year’s first quarter to whatever is the most future due date on any item in the list(s). It will not limit the items to the first quarter, or the current year, unless you tell it to.

6.     If you only want to filter on a single column and a single value, your filter is complete.

7.     If you want to add another condition to the condition set, click on the Add Condition button (Title: Add Condition Icon - Description: Add Condition Icon) to add a row for creating a new filter.

8.     If you want to define an additional condition set, click the Add Filter Group button (Title: Add Filter Group Icon - Description: Add Filter Group Icon). A new Filter Condition Set area is displayed.

Editing Filters

To edit a filter, simply make the necessary changes and click Finish or return to the Views page.

Deleting Filters

To delete a single condition within a Filter Condition Set, click the X to the right of the condition.

To delete an entire Filter Condition Set, click the Remove Group button.

In both cases, the filter is removed immediately; a confirmation message is not displayed.

NOTE: Do not attempt to enter any CAML code in the Filter Builder. The Display Wizard will automatically convert the criteria to CAML for you. If you have CAML criteria that is too complex to enter in the Filter Builder, use the Manual Filter radio button and define the filter in the entry area.

Manually Define a Filter

If you need to define a more complex filter than is possible using the Filter Builder, you can choose the Manual Filter radio button. When this option is selected, the Filter Builder is cleared from the page and an entry area is provided instead.

Type your query in the entry area. All of the date functions listed in the table shown for use in the Filter Builder can be used here, as well.

If you manually build a filter based on a Boolean field, the following values can be entered:

      True

      False

      Yes

      No

      0 (translates to false)

      1 (translates to true)

For more information on filters, visit this site: http://office.microsoft.com/en-us/assistance/HA011611751033.aspx.

Switching Between the Filter Builder and Manually Defining a Filter

If you start defining a filter with the Filter Builder and then click the Manually Edit CAML button, the filter is copied into the Manual Filter area and the Manual Filter radio button is selected. The Filter Builder will remain populated with your original filter for as long as you stay on the page, but any changes made in the Manual Filter area will not be reflected in the Filter Builder. Once you leave the Filtering page, only the manual filter is saved. Anything entered in the Filter Builder will be lost.

What this means is, there is a way to convert the contents to the Filter Builder to the Manual Filt      er, but not vice versa. Also, if you choose to go back to the Filter Builder after using the Manual Filter option and leaving the page, you will have to start from scratch with the Filter Builder.

The filter that corresponds to the radio button that is selected when you leave the page is what will be saved.