Help

Re: Can I have Year (YYYY) ONLY be read as a date?

1064 0
cancel
Showing results for 
Search instead for 
Did you mean: 
KnoxMuseumEd
4 - Data Explorer
4 - Data Explorer

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? 

2 Replies 2

Yes. If you use 

 

DATETIME_PARSE(DATETIME_FORMAT({date field}, "YYYY"))

 

it will show up as 01/01 in the year in question. {date field} could be replaced with an actual number like "2024" (including the " " ).
Sho
11 - Venus
11 - Venus

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}"))
)