---
title: Filter on formula
description: Filters or flags data rows based on custom formula logic using column-based expressions.
group: Data transformation
tags: \[transformation, filtering, flagging]
---

# Filter on formula

## Description

The **Filter on Formula** activity filters rows based on formulas you define. It checks each row using conditions like `[column1]/[column2] > 10`, where `[Column1]` refers to a value in that row. Based on the formula result, it can perform different actions:

- Keep only matching rows
- Remove matching rows
- Clear matching or non-matching cell values
- Flag rows by marking a new column with 1 or 0

> **Example**:
> a sales dataset can use the formula `[Amount]/[Boxes] > 10` to filter high-value shipments. Matching rows are retained using the `KeepMatchingRowsOnly` action.

## Input

- **Data** – Required

## Output

| Output Type | Format  | Notes                                                                     |
| ----------- | ------- | ------------------------------------------------------------------------- |
| **Data**    | Tabular | Returns filtered, flagged, or updated data depending on action configured |

## Configuration Fields

| Field Name           | Description                                                                                                                                                                                                                           |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Column Map**       | A list of column-to-formula mappings. Each mapping applies a logical expression to a specific column.                                                                                                                                 |
| **Actions**          | The action applied to matching or non-matching rows. Supported actions: <ul><li>KeepMatchingRowsOnly</li><li>RemoveMatchingRows</li><li>ClearContentOfMatchingCells</li><li>ClearContentOfNonMatchingCells</li><li>FlagRows</li></ul> |
| **Flag Column Name** | (Optional) Required only when using **FlagRows** action. Specifies the column used to flag the row with 1 (match) or 0 (non-match).                                                                                                   |

## Sample Input

| Product | Amount | Boxes | Region  |
| ------- | ------ | ----- | ------- |
| A       | 1200   | 10    | North   |
| B       | 800    | 5     | South   |
| C       | 90     | 10    | East    |
| D       | 300    | 40    | West    |
| E       | 500    | 20    | Central |

## Sample Configuration

| **Column** | **Formula**               |
| ---------- | ------------------------- |
| Amount     | `[Amount] / [Boxes] > 10` |

## Sample Output

| Product | Amount | Boxes | Region |
| ------- | ------ | ----- | ------ |
| A       | 1200   | 10    | North  |
| B       | 800    | 5     | South  |
