Skip to content

Latest commit

 

History

History
61 lines (41 loc) · 1.98 KB

File metadata and controls

61 lines (41 loc) · 1.98 KB
title Filter transformation in mapping data flow
titleSuffix Azure Data Factory & Azure Synapse
description Filter out rows using the filter transformation in a mapping data flow in Azure Data Factory or Synapse Analytics.
author kromerm
ms.author makromer
ms.reviewer daperlov
ms.subservice data-flows
ms.topic concept-article
ms.custom synapse
ms.date 01/05/2024

Filter transformation in mapping data flow

[!INCLUDEappliesto-adf-asa-md]

[!INCLUDEdata-flow-preamble]

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.

[!VIDEO https://learn-video.azurefd.net/vod/player?id=735b7b28-3280-471d-bd81-c45700908a6e]

Configuration

Use the data flow expression builder to enter an expression for the filter condition. To open the expression builder, select 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":::

Data flow script

Syntax

<incomingStream>
    filter(
        <conditionalExpression>
    ) ~> <filterTransformationName>

Example

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

Related content

Filter out columns with the select transformation.