Filter tool icon

Filter Tool

Last modified: November 05, 2021

Docs are available before the release of Designer Cloud so you can get a sneak peek. This content might change between now and the official release.

One Tool Example

Filter has a One Tool Example. Visit Sample Workflows to learn how to access this and many other examples directly in Alteryx Designer Cloud.

Use Filter to select data using a condition. Rows of data that meet the condition are output to the T anchor. Rows of data that do not meet the condition are output to the False anchor.  

The Filter tool can...

  • Select rows by comparing a column against a static value. See an example.
  • Select rows with or without missing data. See an example.
  • Select rows using date-time data. See an example.
  • Select rows using a multiple-column condition. See an example.
  • Select rows using a compound condition. See an example.

Tool Components

Thumbnail

The Filter tool has 3 anchors. 

  • Input anchor: Use the input anchor to select the data you want to filter.
  • T (True) anchor: The True anchor outputs the rows of data that meet the filter condition.
  • F (False) anchor: The False anchor outputs the rows of data that do not meet the filter condition.

Configure the Tool

Select Basic Filter or Advanced Filter

  • Use the Basic Filter to build a simple query on a single column of data. 
  • Use the Advanced Filter to build complex conditions or conditions using more than 1 column.
Thumbnail

Build Basic Filter

  1. Select the column of data to filter by in Column Name
  2. Select the Operator. Available operators depend on the data type of the column you selected to filter by. See Basic Filter Operators below.
  3. Enter a Value to complete the condition.
    Thumbnail

Basic Filter Operators

Available operators depend on the data type of the column you select to filter by. Learn more about Data Types.

Operator Description Available Data Types
= Value matches input. Numeric, Date, DateTime
Equals Value matches input. String
!= Value does not match input. Numeric, Date, DateTime
Does not equal  Value does not match input. String
> Value is greater than input. Numeric, Date, DateTime
>= Value is greater than or equal to input. Numeric, Date, DateTime
< Value is less than input. Numeric, Date, DateTime
<= Value is less than or equal to input. Numeric, Date, DateTime
Is null Value is a missing or unknown value. Numeric, Date, DateTime, Time, String, Spatial, Boolean
Is not null Value is not a missing or unknown value. Numeric, Date, DateTime, Time, String, Spatial, Boolean
Comes before (<) Value sorts to come before input. String
Comes after (>)  Value sorts to come after input. String
Contains  Value is found in any part of the string. String
Does not contain  Value is not found in any part of the string (case sensitive). String
Is empty Value is Null or "". String
Is not empty  Value is not Null or "". String
Range Value is a selected start and end date. Date, DateTime
Start date and periods after Value is the selected first date and a set number of periods that follow. Date, DateTime
End date and periods before Value is the select last date and a set number of periods that precede. Date, DateTime
Is true Value is true. Boolean
Is false Value is not true. Boolean

Build Custom Filter Using Expressions

To build a custom filter condition, enter your expression syntax into the expression editor. There are also many tools to assist with building Custom filter conditions. See Expression Editor Tips

Thumbnail

Expression Editor Tips

These tools are available within the expression editor to assist with building Custom filter conditions:

  1. Press Ctrl+Space to view a list of all functions.
  2. Type a word or phrase to view a matching list of functions.
  3. Type a [ (left bracket) to view a list of variables to use in the expressions. Variables can be...
    • Data from an incoming connection or a column created in a previous expression.
    • Default global variables.
  4. Select the fx icon to search and browse functions.
  5. Select the x icon to browse or search columns and constants.

Note that the View Recent and Saved Expressions and Save expression options will be available at a later time.

Tool Examples

 Example 1. Select Rows Using Basic Comparison

Use the Basic Filter to select rows by comparing a column against a static value.

Thumbnail

According to the condition of the above Basic Filter, rows with a UserID value greater than 30 are output to the T anchor. Rows with a CustomerID value that is not greater than 30 are output to the F anchor.

Example 2. Select Rows With or Without Missing Data

Use the Basic Filter to select rows without missing data.

Thumbnail

According to the condition of that Basic Filter, rows with a Last value that is not null (missing) are output to the T anchor. Rows with a null value in Last are output to the F anchor.

Example 3. Select Rows Using Date-Time Data

Use the Basic Filter to select rows with a relative date. 

Thumbnail

According to the condition of the above Basic filter, rows with a Registration Date/Time that is less than or equal to today's date are output to the T anchor. Rows with a date after today's date are output to the F anchor.

Date-Time Filter Tips

  • The dynamic options, today, tomorrow, and yesterday, update the workflow to that relative date when the workflow is run.
  • The Start date and periods after or End date and periods before operators allow you to specify a date range by selecting a specific date, a Period type (Days, Months, Weeks, Quarters, or Years), and the Number of periods.
  • Select Filter only Date data to truncate date-time data to use only the date data.

Example 4. Select Rows Using a Multiple-Column Condition

Use the Advanced Filter to create a condition that references more than 1 column to select rows. 

Thumbnail

According to the condition of the above Advanced Filter, rows with a POP2005 value that is greater than or equal to the POP2010 value are output to the T anchor. Rows with a POP2005 value that is less than the POP2010 value are output to the F anchor.

Example 5. Select Rows Using a Compound Condition

Use the Advanced Filter to create compound conditions, in other words, more than 1 condition joined by AND or OR operators.

Thumbnail

According to the condition of the above Advanced Filter, rows where the state is Alabama and the population is greater than or equal to 1500 are output to the T anchor. All other rows are output to the F anchor. 

Troubleshooting

Treat numbers with more than 15 digits as strings to prevent a loss of precision. You can set the field type to a string using the Select Tool.

Was This Page Helpful?

Running into problems or issues with your Alteryx product? Visit the Alteryx Community or contact support. Can't submit this form? Email us.