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.
Extract uses two different utterance variations:
Extract the <date parts> from <column> and call the output columns <names>
Extract attribute <attributes> from <json column>
Extract uses the following parameters:
date parts. A unit of time or a date, including:
- Seconds since epoch. The number of seconds that have elapsed since January 1, 1970 (the Unix epoch).
- Day of Week
- Day of Year
- YYYYMM. The year and month. For example, extracting YYYYMM from 4/21/2021 returns 2021-4.
- YYYYQ. The year and quarter. For example, extracting YYYYQ from 4/21/2021 returns 2021-2.
attributes. The JSON property to extract.
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 display panel along with a success message in the chat box.
Otherwise, an error message is shown in the chat box.
Imagine a dataset called birthdates where each row represents a person and that contains the following columns:
- 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.