title | titleSuffix | description | author | ms.author | ms.reviewer | ms.service | ms.subservice | ms.topic | ms.custom | ms.date |
---|---|---|---|---|---|---|---|---|---|---|
Filter transformation in mapping data flow |
Azure Data Factory & Azure Synapse |
Filter out rows using the filter transformation in a mapping data flow in Azure Data Factory or Synapse Analytics. |
kromerm |
makromer |
daperlov |
data-factory |
data-flows |
conceptual |
synapse |
09/09/2021 |
[!INCLUDEappliesto-adf-asa-md]
[!INCLUDEdata-flow-preamble]
The Filter transforms allows row filtering based upon a condition. The output stream includes all rows that matching the filtering condition. The filter transformation is similar to a WHERE clause in SQL.
[!VIDEO https://www.microsoft.com/en-us/videoplayer/embed/RE4xnxN]
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.
:::image type="content" source="media/data-flow/filter1.png" alt-text="Filter transformation":::
<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:
:::image type="content" source="media/data-flow/filter1.png" alt-text="Filter transformation":::
The data flow script for this transformation is in the snippet below:
CleanData
filter(
year <= 1960
) ~> FilterBefore1960
Filter out columns with the select transformation