The FilterTransformation filters rows in a data flow based on a specified predicate. A predicate is a function that returns true or false; if true, the row is kept, otherwise, it is discarded.
Note
The `FilterTransformation` is not the only method to filter values in a data flow. You can also use predicates directly when linking components. See below for details.
The FilterTransformation is a non-blocking transformation, meaning it only stores the current row in memory, plus a few additional rows in an input buffer to improve throughput. It has one input buffer and performs the filtering in-memory without blocking the flow of data.
FilterTransformation catches and forwards exceptions encountered during execution. By default, any exception will fault the entire data flow network. However, you can forward the exceptions to another part of the network using LinkErrorTo(). This behavior is not available when using predicates; in those cases, any uncaught exception will silently discard the record by default.
The FilterTransformation provides two properties to track the number of rows that were processed during execution.
FilteredCount keeps track of the number of rows that were filtered out (i.e., rows that did not pass the predicate).
PassedCount counts the number of rows that passed the predicate and were passed along to the next component in the data flow.
Here’s an example usage:
In the above example, after executing the network, the PassedCount will reflect the number of rows that passed the filter, while FilteredCount shows how many were discarded.