Extract
Extract
helps you explore and clean your data by allowing you to extract fields from a column that contains date or time values or attributes from a column that contains JSON values. For example, if you had a Date column in your dataset, you could use Extract
to calculate and extract which quarter of the year the date is in.
Format
Extract
uses a single format: Extract the <date parts> from the column <column name> and call the output columns <names>
Parameters
Extract
uses the following parameters:
date parts
(required). A unit of time or a date, including:- Microsecond
- Millisecond
- Second
- Seconds since epoch. The number of seconds that have elapsed since January 1, 1970 (the Unix epoch).
- Minute
- Hour
- Day
- of Week
- of Year
- First Day of Week
- First Day of Month
- Week
- Month
- YYYYMM. The year and month. For example, extracting YYYYMM from 4/21/2021 returns 2021-4.
- Quarter
- YYYYQ. The year and quarter. For example, extracting YYYYQ from 4/21/2021 returns 2021-2.
- Year
- Decade
- Century
column name
(required). The name of the column to extract date parts from.names
(optional). The names of the output columns.
Output
If the date part or attribute is successfully extracted, a new column is created and appended to the end of the dataset. The updated dataset is then shown in the Data tab along with a success message in the conversation history.
Otherwise, an error message is shown.
Examples
Imagine a dataset called birthdates where each row represents a person and that contains the following columns:
- Name
- Age
- Gender
- Birthdate (in the format “Month Day, Year”)
To extract the day each person in the dataset was born, enter Extract the day from the column Birthdate and call the output columns Birth Day
.
To extract the quarter of the year in which each person was born, enter Extract the quarter from the column Birthdate call the output columns Birth Quarter
.