Filtering Rows: Basic & Custom Filter Tool with Boolean Logic
Overview & Learning Objectives
The Filter tool queries incoming records against boolean conditional statements. Unlike SQL `WHERE` clauses that discard non-matching rows, the Alteryx Filter tool bifurcates the data stream into two distinct output anchors: the True (`T`) anchor outputs rows meeting the criteria, while the False (`F`) anchor preserves non-matching rows for separate handling, exception tracking, or error routing.
- Configure Basic Filters for simple single-condition rules (Equals, Greater than, IsNull).
- Build Custom Filter expressions using Alteryx conditional syntax and boolean operators (`AND`, `OR`, `NOT`).
- Route dirty or invalid records from the False anchor into dedicated error-handling sub-streams.
Industry Standard
Standard: Production ETL architecture at Swiggy and Amazon routes the False (`F`) anchor of validation filters into an Exception Log table to generate automated audit reports on unfulfilled or corrupted orders.
Real-World Example: ScoopCraft Ice Cream VIP Order Segmentation
ScoopCraft routes high-value catering orders (>= ₹2,000) for priority fulfillment while directing retail orders (< ₹2,000) to standard lines.
| Order ID | Customer Name | Order Total | Filter Condition (`Total >= 2000`) | Assigned Output Anchor |
|---|---|---|---|---|
| ORD-101 | Taj Banquets | ₹8,500 | TRUE | T Anchor (Priority Catering Stream) |
| ORD-102 | Rohan Sharma | ₹350 | FALSE | F Anchor (Standard Retail Stream) |
| ORD-103 | Marriott Suites | ₹12,400 | TRUE | T Anchor (Priority Catering Stream) |
| ORD-104 | Anita Roy | ₹650 | FALSE | F Anchor (Standard Retail Stream) |
Configuration & Core Workflow
-- 1. Basic Filter
[order_status] = "Delivered"
-- 2. Custom Filter with Compound Boolean Logic
[order_status] == "Delivered"
AND [order_total] >= 1000
AND NOT IsNull([delivery_rider_id])
AND DateTimeDiff(DateTimeToday(), [order_date], "days") <= 30
Parameters Breakdown
Basic Filter: Point-and-click interface to evaluate one field using standard operators (equals, null, greater than).Custom Filter: Expression editor enabling multi-field formulas, mathematical evaluations, and complex boolean logic.True Anchor (T): Outputs records where the conditional expression evaluates to TRUE.False Anchor (F): Outputs records where the conditional expression evaluates to FALSE or NULL.
Sample Walkthrough (Q&A)
Question: What happens to records where the filtered column value is `NULL` when testing `[Price] > 100`?
Formula / Action: [Price] > 100 on a NULL row
Result: The record is routed to the False (`F`) anchor.
Explanation: In Alteryx, conditional comparisons against NULL evaluate to FALSE, cleanly directing missing values to the False anchor.
Common Mistakes & Limitations
- Using single equals `=` instead of double equals `==` in complex custom conditional expressions (Alteryx supports both, but `==` is recommended for standard programming readability).
- Discarding the False anchor completely without checking if legitimate records were dropped due to accidental case mismatches (e.g. "delivered" vs "Delivered").
Keyboard Shortcuts
| Action | Windows | Mac |
|---|---|---|
| Switch to Custom | Click "Custom Filter" radio button | Click Custom Filter |
| Insert Field Name | Double click field from tree list | Double click field |
Pro Tips & Modern Alternatives
- Use `REGEX_Match([field], "pattern")` inside a Custom Filter for sophisticated text pattern searches.
- Use the `Select Records` tool when filtering by specific ordinal row index positions (e.g. rows 1 to 50).