Date Operation
The Date Operation node provides a set of functionalities to handle date columns effectively within the dataset. Users can perform various operations such as adding or subtracting specific durations from dates, extracting specific components like year, month, or day from dates, and calculating differences between dates. These operations enable users to manipulate date data according to their specific requirements.
Configuration
Upon selecting the Date Operation node, users are presented with the following configuration options:
On Column: Dropdown menu listing all available date columns in the dataset for selection.
Operation Type: Users can choose from the following functions:
1. Add: Adds a specified value to the selected date column.
Date Type: Allows selection of year, month, or day.
Date Value: Input the value to add.
Output Column: Choose to replace the existing column or create a new one with a specified name.
2. Subtract: Subtracts a specified value from the selected date column.
Date Type: Allows selection of year, month, or day.
Date Value: Input the value to subtract.
Output Column: Choose to replace the existing column or create a new one with a specified name.
3. Extract: Extracts a specific part (year, month, or day) from the selected date column.
Date Type: Allows selection of year, month, or day.
Output Column: Specify a name for the new column.
4. Difference: Determines the difference between two date columns or a date column and a value.
Input Type: Choose between an existing column and a value. For an existing column, calculate the difference between two date columns.
Granularity: Select year, month, or day.
Output Column: Name the new column for the result.
For a value, input a specific date to calculate the difference.
Granularity: Select year, month, or day.
Output Column: Name the new column for the result.
5. Static: Creates a custom date column with a fixed value throughout all rows.
Static Value: Provide a custom input date.
Output Column: Choose to replace the existing column or create a new one with a specified name.
Example Usage
Let's consider a scenario with dataset consisting of four events, each with a unique EventID, Event Name, a Start Date, and an EndDate. The dataset is structured to provide essential scheduling information for different types of events.
Dataset
EventID | EventName | StartDate | EndDate |
|---|---|---|---|
1 | Conference | 01/10/2024 | 03/10/2024 |
2 | Workshop | 15/11/2024 | 17/11/2024 |
3 | Webinar | 20/12/2024 | 20/12/2024 |
4 | Seminar | 05/01/2025 | 06/01/2025 |
Add
Problem Statement: The event coordinator wants to calculate the follow-up date for each event by adding 5 days to each EndDate.
Configuration:
On Column: Select EndDate.
Operation Type: Choose Add.
Date Type: Select Day.
Date Value: Enter 5.
Output Column: Create a new column named FollowUpDate.
Resultant Output
EventID | EventName | StartDate | EndDate | FollowUpDate |
|---|---|---|---|---|
1 | Conference | 01/10/2024 | 03/10/2024 | 08/10/2024 |
2 | Workshop | 15/11/2024 | 17/11/2024 | 22/11/2024 |
3 | Webinar | 20/12/2024 | 20/12/2024 | 25/12/2024 |
4 | Seminar | 05/01/2025 | 06/01/2025 | 11/01/2025 |
Subtract
Problem Statement: The team needs to prepare for each event by starting the setup 3 days before each StartDate.
Configuration:
On Column: Select StartDate.
Operation Type: Choose Subtract.
Date Type: Select Day.
Date Value: Enter 3.
Output Column: Create a new column named SetupStartDate.
Resultant Output
EventID | EventName | StartDate | EndDate | SetupStartDate |
|---|---|---|---|---|
1 | Conference | 01/10/2024 | 03/10/2024 | 28/09/2024 |
2 | Workshop | 15/11/2024 | 17/11/2024 | 12/11/2024 |
3 | Webinar | 20/12/2024 | 20/12/2024 | 17/12/2024 |
4 | Seminar | 05/01/2025 | 06/01/2025 | 02/01/2025 |
Difference
Problem Statement: Calculate the duration of each event by finding the difference between EndDate and StartDate.
Configuration:
On Column: Select StartDate.
Operation Type: Choose Difference.
Input Type: Select Existing Column and choose EndDate.
Granularity: Select Day.
Output Column: Create a new column named EventDuration.
Resultant Output
EventID | EventName | StartDate | EndDate | EventDuration |
|---|---|---|---|---|
1 | Conference | 01/10/2024 | 03/10/2024 | 2 |
2 | Workshop | 15/11/2024 | 17/11/2024 | 2 |
3 | Webinar | 20/12/2024 | 20/12/2024 | 0 |
4 | Seminar | 05/01/2025 | 06/01/2025 | 1 |
Extract
Problem Statement: The financial department needs to extract the month from each StartDate to analyze which months have the highest number of events.
Configuration:
On Column: Select StartDate.
Operation Type: Choose Extract.
Date Type: Select Month.
Output Column: Create a new column named EventMonth.
Resultant Output
EventID | EventName | StartDate | EndDate | EventMonth |
|---|---|---|---|---|
1 | Conference | 01/10/2024 | 03/10/2024 | 10 |
2 | Workshop | 15/11/2024 | 17/11/2024 | 11 |
3 | Webinar | 20/12/2024 | 20/12/2024 | 12 |
4 | Seminar | 05/01/2025 | 06/01/2025 | 1 |
Static
Problem Statement: The reporting team wants to add a column indicating the last update date for all events, setting a fixed value of 01/09/2024.
Configuration:
Operation Type: Choose Static.
Static Value: Enter 01/09/2024.
Output Column: Create a new column named LastUpdated.
Resultant Output:
EventID | EventName | StartDate | EndDate | LastUpdated |
|---|---|---|---|---|
1 | Conference | 01/10/2024 | 03/10/2024 | 01/09/2024 |
2 | Workshop | 15/11/2024 | 17/11/2024 | 01/09/2024 |
3 | Webinar | 20/12/2024 | 20/12/2024 | 01/09/2024 |
4 | Seminar | 05/01/2025 | 06/01/2025 | 01/09/2024 |