- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎Dec 05, 2023 10:31 AM
Hi! I am using Airtable to create an inventory of items in a museum of education related items. The vast majority of the items in our collection only have a year attributed to the item (i.e. class of '89, picture taken 1976, Spring 1935, etc). I am wanting to create a timeline view to show a history of certain schools, subjects, and other grouping criteria. Is there a way to have just a year (YYYY) be read as a date for timeline and gantt purposes?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎Dec 06, 2023 08:31 AM
Yes. If you use
DATETIME_PARSE(DATETIME_FORMAT({date field}, "YYYY"))

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎Dec 06, 2023 03:34 PM
Hi @KnoxMuseumEd,
If there is only one number in the description, extraction is easy.
When multiple numbers are present, more detailed conditions are required.
SWITCH(
LEN(REGEX_EXTRACT({description},"\\d{2,4}")),
2, VALUE(REGEX_EXTRACT({description},"\\d{2,4}"))+1900,
4,VALUE(REGEX_EXTRACT({description},"\\d{2,4}"))
)
