Filter rows
The Filter rows step keeps rows that satisfy a set of rules. You can use this step to create simple filters with one rule, or complex filters with many rules.
Check out this Parabola University video to see the Filter rows step at work.
Input/output
The input data we'll connect to this step has 15 rows of webinar registrants.
Let's say we want to filter this for people who registered after February 1, 2022. By setting a rule to include rows where the value in 'Registration Time' column is greater than or equal to '2022-02-01 00:00:00', we immediately get nine rows of data showing who registered after February 1, 2022.
Custom settings
By default, this step will keep rows only if they follow any of the rules. This means that if a row satisfies one of the rules, that row will be kept. You can change this to keep rows only if they match all of the rules by clicking '+ Add a rule set' and changing 'OR' to 'AND' between them.
Now it's time to set up filters for rows. For each rule, you'll select a column, a filtering condition, and a matching value.
Available filtering conditions:
- is blank
- is not blank
- is equal to
- is not equal to
- contains
- does not contain
- is greater than
- is greater than or equal to
- is less than
- is less than or equal to
To add another rule, click on the gray '+ Add a rule set' button to configure another rule.
The 'contains', 'does not contain', 'is equal to', and 'is not equal to' filter operations allows multiple criteria fields.
You can compare columns inside of your Filter rows steps by entering the column name wrapped in curly braces (e.g.: '{Sub-Total}').
Helpful tips
- Keeping rows between two values: If you need to only keep rows in a column whose values are between two values, then you'd use two separate rules. Let's say I want to keep values in a column that are between 5 and 10 inclusive. I would set one rule to keep all rows that are greater than or equal to 5. I would then set a second rule to keep all rows less than or equal to 10, and select the 'AND' option.
- Filtering dates: The Filter rows step can generally handle filtering for dates that match a certain criteria without any additional date formatting required. However, if you're experiencing any issues with filtering dates, we recommend trying to convert your dates into a Unix format or Lexicographical format. To update your date formats, use a Format dates step before sending your data to the Filter rows step. For Unix format, use capital X for precision to the second and lowercase x for precision to the millisecond. For lexicographical format, use YYYY-MM-DD HH:mm:ss.
- Accounting for text casing: Please note that rules are not case sensitive.
- Reversing the filtering logic: If you set up a filter with multiple rules and wish to instead see the rows that are being removed by the filter, you can reverse your filtering by changing 'Keep rows' to 'Remove rows'.
- Filtering symmetrically: If you need to split your table to create separate branches that will eventually be merged back together to recreate the complete data set, you will use a few Filter rows steps while making sure you're not duplicating or losing any rows in that process. For example, let's say you have data that spans three months (October, November, and December) and you need to process each month differently. You want one Filter rows step per month. A good way to make sure you successfully filtered symmetrically is to use a Stack tables step at the end of your separate branches to merge the data back together. The resulting row count should match the row count of your starting data before the Filter rows steps.