Looker Studio is now called Data Studio. Learn more about this change.

QUARTER

Returns the quarter of the year for a given date.

Sample usage

QUARTER(Date)

Syntax

1) Returns the quarter from a Date value.

QUARTER( date_expression )

2) Returns the quarter from a compatibility mode Date value.

QUARTER( X [, format_string ])

Parameters

  • date_expression - a Date & Time field or expression.
  • X - a field or expression that evaluates to Text, Number, or compatibility mode Date.
  • format_string - format for X. Optional if X is correctly configured as a semantic date field.

Input format for compatibility mode dates

Supported date functions accept the following input formats if X is a Text field or expression, or compatibility mode Date:

  • Any valid strptime format is accepted.
  • 'BASIC': %Y/%m/%d-%H:%M:%S
  • 'DEFAULT_DASH': %Y-%m-%d [%H:%M:%S]
  • 'DEFAULT_SLASH': %Y/%m/%d [%H:%M:%S]
  • 'DEFAULT_DECIMAL': %Y%m%d [%H:%M:%S]
  • 'RFC_1123': for example, 2008年5月24日 20:09:47 GMT
  • 'RFC_3339': for example, 2008年05月24日T20:09:47Z
  • 'DECIMAL_DATE': same as 'DEFAULT_DECIMAL'

Supported time functions accept the following input format if X is a Number field or expression:

  • 'SECONDS': seconds since Epoch
  • 'MILLIS': milliseconds since Epoch
  • 'MICROS': microseconds since Epoch
  • 'NANOS': nanoseconds since Epoch
  • 'JULIAN_DATE': days since Epoch

Examples

Example formula Input Output
QUARTER(Date) Jan 1, 2019 1
QUARTER(Date as Text, 'BASIC') 2019年01月01日-09:40:45 1
QUARTER(Date as Number, 'SECONDS') 1561784874 2

QUARTER(Date as lots of Numbers, 'MILLIS')

1562004058620 3

Notes

This function works with both compatibility mode dates and upgraded Date and Date & Time data types.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026年08月26日 UTC.