Filter transformation in mapping data flow
APPLIES TO: Azure Data Factory Azure Synapse Analytics
Try out Data Factory in Microsoft Fabric, an all-in-one analytics solution for enterprises. Microsoft Fabric covers everything from data movement to data science, real-time analytics, business intelligence, and reporting. Learn how to start a new trial for free!
Data flows are available both in Azure Data Factory and Azure Synapse Pipelines. This article applies to mapping data flows. If you are new to transformations, please refer to the introductory article Transform data using a mapping data flow.
The Filter transforms allows row filtering based upon a condition. The output stream includes all rows that match the filtering condition. The filter transformation is similar to a WHERE clause in SQL.
Use the data flow expression builder to enter an expression for the filter condition. To open the expression builder, click on the blue box. The filter condition must be of type boolean. For more information on how to create an expression, see the expression builder documentation.
Data flow script
<incomingStream> filter( <conditionalExpression> ) ~> <filterTransformationName>
The below example is a filter transformation named
FilterBefore1960 that takes in incoming stream
CleanData. The filter condition is the expression
year <= 1960.
In the UI, this transformation looks like the below image:
The data flow script for this transformation is in the snippet below:
CleanData filter( year <= 1960 ) ~> FilterBefore1960
Filter out columns with the select transformation