DateTrunc
Description
DateTrunc truncates a date to the specified granularity.
Syntax
Parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
date |
Yes | Date, field, or expression | Date to truncate. |
unit |
Yes | String | Granularity such as "day", "week", "month", "quarter", or "year". |
Notes
Use this function in calculated fields, metric expressions, or query expressions where the function category is supported.
Example
The expression returns the calculated result according to the current query context.