Category: Date and time

EXTEND_TIME_WINDOW

EXTEND_TIME_WINDOW widens the period of an input table beyond the reporting window of the query, backwards and forwards.

Syntax

EXTEND_TIME_WINDOW(table_name, days_retro, days_future)

AMC specifics

  • The two numbers give how many days the table is extended backwards and into the future.
  • The extension is query-scoped: once applied to a table in one CTE it applies to every later reference to that table.
  • To restrict a single CTE to the normal period, filter explicitly with BUILT_IN_PARAMETER('TIME_WINDOW_START') and BUILT_IN_PARAMETER('TIME_WINDOW_END').

Related functions: SECONDS_BETWEEN, DATE_TRUNC

Source: advertising.amazon.com (retrieved 2026-10-09)