---
title: Filter on falsy values
description: Filter rows or flag cells based on predefined falsy values.
category: Data Cleaning
tags: [falsy, boolean, null check, validation, filter]
---

# Filter on falsy values

## Description

The **Filter on Falsy Values** activity evaluates a specific column for values that are considered "falsy" and applies the configured action to the matching rows.  
Falsy values typically represent the absence of meaningful data and include:

- `false`
- `0`
- `NaN`
- `""` (empty string)
- `undefined`

This is useful in workflows that require cleansing, flagging, or isolating incomplete or semantically empty data.

> **Use case**:  
> Use this activity before transformations or aggregations to clean data rows that might result in logical inconsistencies or misleading results due to falsy entries.

---

## Input

| Type | Description                                 |
| ---- | ------------------------------------------- |
| Data | Input dataset containing the column to test |

---

## Output

| Type             | Description                                        |
| ---------------- | -------------------------------------------------- |
| Transformed Data | Dataset with rows filtered or flagged as per logic |

---

## Configuration Fields

| Field Name                | Required    | Description                                                                                                                                                                                                                                                                 |
| ------------------------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Column**                | Yes         | Specifies the column to evaluate for falsy values.                                                                                                                                                                                                                          |
| **Falsy Values**          | Yes         | Select one or more falsy values to match. Supported values: `false`, `0`, `NaN`, `""` (empty string), `undefined`.                                                                                                                                                          |
| **Actions**               | Yes         | Action to apply when a match is found:<ul><li>**Keep Matching Rows** – retain only rows with falsy values</li><li>**Remove Matching Rows** – exclude rows with falsy values</li><li>**Flag Rows** – add a column flagging matching rows (1 = match, 0 = no match)</li></ul> |
| **Flag Rows Column Name** | Conditional | Name of the flag column to be created. Required only when action is **Flag Rows**.                                                                                                                                                                                          |

---

## Sample Input

| column_name | other_column |
| ----------- | ------------ |
| 1           | data         |
| 0           | more data    |
| NaN         | test         |
|             | example      |
| 2           | content      |

---

## Sample Configuration 1

| Field                 | Value         |
| --------------------- | ------------- |
| Column                | `column_name` |
| Falsy Values          | `0`, `NaN`    |
| Action                | `Flag Rows`   |
| Flag Rows Column Name | `falsy_flag`  |

<!-- ![alt text](filter-on-falsy-values-img-01.png) -->

---

## Sample Output 1 (Action: Flag Rows)

| column_name | other_column | falsy_flag |
| ----------- | ------------ | ---------- |
| 1           | data         | 0          |
| 0           | more data    | 1          |
| NaN         | test         | 1          |
|             | example      | 0          |
| 2           | content      | 0          |

---

## Sample Configuration 2

| Field        | Value                  |
| ------------ | ---------------------- |
| Column       | `column_name`          |
| Falsy Values | `0`, `NaN`, `""`       |
| Action       | `Remove Matching Rows` |

<!-- ![alt text](filter-on-falsy-values-img-02.png) -->

---

## Sample Output 2 (Action: Remove Matching Rows)

| column_name | other_column |
| ----------- | ------------ |
| 1           | data         |
| 2           | content      |

---

> You can chain this with **Filter on Bad Meaning** or **Fill Columns** for improved data quality and resilience.
