AT_DATE

Syntax

AT_DATE( measure, date_dimension, date_expr )
AT_DATE( measure, date_dimension, date_expr
         [ BEFORE FILTER BY ... ]
         [ IGNORE DIMENSIONS ... ]
       )

More info:

Description

Re-evaluate measure for a date/time specified by date_expr. The date_dimension argument is the dimension along which the offset is made.

See also AGO, LAG.

Argument types:

  • measureAny
  • date_dimensionDate | Datetime
  • date_exprDate | Datetime

Return type: Same type as (measure)

Note

The first argument must be a measure (aggregated expression), otherwise an error will be raised.

Examples

AT_DATE(SUM([Sales]), [Order Date], #2019-01-01#)
AT_DATE(SUM([Sales]), [Order Date], DATETRUNC([Order Date], "month"))

Data source support

ClickHouse 19.13, Microsoft SQL Server 2017 (14.0), MySQL 5.6, PostgreSQL 9.3.

Previous