User Tools

Site Tools


transformations:makedatetimecolumns

Make Date/Time Columns

Take a column with dates and produce one or several columns with various components (e.g. year, or weekday) of the original dates, or time period names.

Column that can be created:

  • Formatted date
  • Year
  • Quarter (e.g. Q1)
  • Year-quarter (e.g. 2019-Q1)
  • Month name
  • Year-month (e.g. 2019-Apr)
  • Day
  • Week day
  • Day of year
  • ISO week number
  • Month start
  • Month end
  • Week start
  • Week end
  • Hour (12-hour)
  • Hour (24-hour)
  • AM/PM
  • Minutes
  • Seconds
  • Milliseconds

Example

Table before:

Date
2020-Nov-28
2020-Nov-29
2020-Nov-30

Objective: create columns with year-quarter, week day, and ISO week number.

Table after:

Date Year-quarter Week day ISO Week number
2020-Nov-28 2020-Q4 Sat 48
2020-Nov-29 2020-Q4 Sun 48
2020-Nov-30 2020-Q4 Mon 49

See also

transformations/makedatetimecolumns.txt · Last modified: 2021/04/02 04:33 by dmitry