---
title: Filter on date range
description: Filter rows based on a specified date range within a selected column.
category: Data transforms
tags: [date, filter, range, time series, validation]
---

# Filter on date range

## Description

The **Filter on Date Range** activity allows you to filter records by evaluating whether values in a specific date column fall within a user-defined date range. This is useful for time-based slicing, such as extracting data for a specific week, month, quarter, or custom period.

You can configure whether to **keep**, **remove**, **flag**, or **clear** data based on whether the date falls within the defined range.

> **Use case**:  
> This activity is useful in financial reporting, event-based filtering, log analysis, or seasonal trend extractions where date boundaries matter.

---

## Input

| Type | Description                                       |
| ---- | ------------------------------------------------- |
| Data | Input dataset containing at least one date column |

---

## Output

| Type             | Description                            |
| ---------------- | -------------------------------------- |
| Transformed Data | Filtered, flagged, or modified dataset |

---

## Configuration Fields

| Field Name                | Required    | Description                                                                                                                                                                                                                                                                                                                                                                               |
| ------------------------- | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Column**                | Yes         | Column containing date values to apply the range filter.                                                                                                                                                                                                                                                                                                                                  |
| **Minimum Value**         | No          | Lower bound of the date range. Rows with dates earlier than this are excluded unless another action is selected.                                                                                                                                                                                                                                                                          |
| **Maximum Value**         | No          | Upper bound of the date range. Rows with dates later than this are excluded unless another action is selected.                                                                                                                                                                                                                                                                            |
| **Actions**               | Yes         | Action to perform:<ul><li>**Keep Matching Rows** – Retain rows within the range</li><li>**Remove Matching Rows** – Remove rows within the range</li><li>**Flag Rows** – Add a flag column indicating if row matches</li><li>**Clear Content of Matching Cells** – Set matching cells to empty</li><li>**Clear Content of Non-Matching Cells** – Set non-matching cells to empty</li></ul> |
| **Flag Rows Column Name** | Conditional | Name of the column to store flags (`1` for match, `0` otherwise). Only shown when **Action** is **Flag Rows**.                                                                                                                                                                                                                                                                            |

---

## Sample Input

| date_column | value |
| ----------- | ----- |
| 2024-12-31  | 100   |
| 2025-01-01  | 200   |
| 2025-01-10  | 300   |
| 2025-01-15  | 400   |
| 2025-01-20  | 500   |

---

## Sample Configuration

| Field         | Value              |
| ------------- | ------------------ |
| Column        | `date_column`      |
| Minimum Value | `2025-01-01`       |
| Maximum Value | `2025-01-15`       |
| Action        | Keep Matching Rows |

<!-- ![alt text](filter-on-date-range-img.png) -->

---

## Sample Output

| date_column | value |
| ----------- | ----- |
| 2025-01-01  | 200   |
| 2025-01-10  | 300   |
| 2025-01-15  | 400   |

---

> Combine this activity with **Extract Date Component** to build filters for month, year, or quarter-based logic.
