Date Format
Extract part of date columns to new formats
You can use the Date Format tool to extract parts of date columns - such as a weekday or year. It is particularly helpful in combinations with others tools. Such as a Filter to keep transactions from the current year or a Group By + Combine to merge datasets by Year/Month.
The columns you use in the Date Format tool must be formatted as a date/datetime. Use the Change Columns tool to change column formats.
Configuration
The Date Format tool consists of two required input.
Select Date Column
Select the column from which you want to extract part of the date
Select the Part
Select the parts of the you want to extract. You can choose from the following:
- Date: helpful if you just want to the date from a column that has timestamps
- Hour: extract the hour from the timestamp
- Week: extract the ISO week from a date
- Weekday: extract the weekday from a date (1 = Monday)
- Month: extract the month from a date (1 = January)
- Monthname: extract the month name from a date (e.g. January)
- First Day of Month: get the first day of a given month from a date (e.g. 2024-10-10 → 2024-10-01)
- Last Day of Month: get the last day of a given month from a date (e.g. 2024-10-10 → 2024-10-31)
- Quarter: extract the quarter that a date is in
- Year Half: extract the year half that a date is in (e.g. 2024-10-10 → 2)
- Year: extract the year of a date (e.g. 2024-10-10 → 2024)
When To Use
The Date Format tool is typically used alongside other tools. The output of the tool oftentimes is necessary to continue the analysis.
- Extract the year of a date column and use a Filter tool and Today tool to ensure you only look at the current year
- Extract a month and a year from a date column to prepare an aggregation with a Group By and subsequently a Combine
- Extract the first of the month to standardize payroll transactions