Amazon QuickSight
User Guide

The AWS Documentation website is getting a new look!
Try it now and let us know what you think. Switch to the new look >>

You can return to the original look by selecting English in the language selector above.


extract returns a specified portion of a date value. Requesting a time-related portion of a date that doesn't contain time information returns 0.

extract is supported for use with analyses based on SPICE data sets.


extract(period, date)



The period that you want extracted from the date value. Valid periods are as follows:

  • YYYY: This returns the year portion of the date.

  • Q: This returns the quarter that the date belongs to (1–4).

  • MM: This returns the month portion of the date.

  • DD: This returns the day portion of the date.

  • WD: This returns the day of the week as an integer, with Sunday as 1.

  • HH: This returns the hour portion of the date.

  • MI: This returns the minute portion of the date.

  • SS: This returns the second portion of the date. This argument is not supported when added inside SPICE-based analyses.


A date field or a call to another function that outputs a date.

Return Type



The following example extracts the day from a date value.

extract('DD', orderDate)

The following are the given field values.

orderDate ========= 01/01/14 09/13/16

For these field values, the following values are returned.

01 13