Skip to main content
YEAR_WEEK
Tom Williams avatar
Written by Tom Williams
Updated over a year ago

Type: Formatter

Function: YEAR_WEEK

Syntax: YEAR_WEEK(datetime)

Description: Format a timestamp field in YYYY-WXX format (e.g. “2023-W17”). This formatter is used to group records in “year + week of the year” blocks.

Sample usage:

  • YEAR_WEEK("2020-04-17") returns 2020-W16

  • YEAR_WEEK(created_at) returns the created_at field value in YYYY-WXX format

Did this answer your question?