---
title: Extract date component
description: Extract specific parts of a date (e.g., Year, Month, Day) into new columns.
category: Data Transformation
tags: [date, transform, extract, datetime, formatting]
---

# Extract date component

## Description

The **Extract Date Component** activity enables users to extract individual date components—such as **Year**, **Month**, **Day**, **Week Number**, etc.—from a specified date column. It adds these components as new columns to the dataset.

> **Use Case**:  
> Useful in reporting and time-based aggregations where date breakdowns like `Transaction_Year`, `Transaction_Month`, and `Transaction_Weekday` are needed for grouping, filtering, or visualization.

---

## Input

| Type | Description                            |
| ---- | -------------------------------------- |
| Data | Dataset with one or more date columns. |

---

## Output

| Type             | Format | Description                                        |
| ---------------- | ------ | -------------------------------------------------- |
| Transformed Data | Table  | Input data along with additional extracted fields. |

---

## Configuration Fields

| Field Name            | Required | Description                                                             |
| --------------------- | -------- | ----------------------------------------------------------------------- |
| **Date column**       | Yes      | The column from which to extract date components.                       |
| **Start Day Of Week** | No       | Sets the start day of the week (e.g., Monday or Sunday).                |
| **Components**        | Yes      | List of components to extract: Year, Month, Day, Week, DayOfWeek, etc.  |
| **Prefix**            | No       | Prefix for the newly created columns (e.g., `Transact_`).               |
| **Include original**  | No       | If enabled, keeps the original date column along with extracted fields. |

---

## Sample Input

| ID  | Date       |
| --- | ---------- |
| 1   | 2023-09-15 |
| 2   | 2022-05-20 |
| 3   | 2021-12-30 |

---

## Sample Configuration

| Field               | Value              |
| ------------------- | ------------------ |
| ` Date column`      | `Date`             |
| `Start Day Of Week` | `Monday`           |
| `Components`        | `Year, Month, Day` |
| `Prefix `           | `Transact_`        |
| `Include original`  | `True`             |

---

## Sample Output

| ID  | Date       | Transact_Year | Transact_Month | Transact_Day |
| --- | ---------- | ------------- | -------------- | ------------ |
| 1   | 2023-09-15 | 2023          | 09             | 15           |
| 2   | 2022-05-20 | 2022          | 05             | 20           |
| 3   | 2021-12-30 | 2021          | 12             | 30           |

---
