Skip to content

Derived Metric Time Constraint Definition

Definition

type = TO_DATE

expr = -N {offset granularity} of 0 {time granularity}

Examples

Last 7 days: -6 day of 0 day

Last 7 workdays: -6 day_workday of 0 day

From the past 7 months to the current day: -7 month of 0 day

From the past 1 year to the current month: -1 year of 0 month

MTD (To Date)

Definition

type = GRAIN_TO_DATE

expr = -N {offset granularity} to 0 {time granularity}

Examples

Month to date: 0 month to 0 day

Year to current month: 0 year to 0 month

Previous year to current month: -1 year to 0 month

Period End and Period Start

Definition

type = SPECIFY_DATE

expr = start {time granularity} of M {offset granularity}

expr = end {time granularity} of M {offset granularity}

Examples

Start of last month: start day of -1 month

First workday at the start of last month: start day_workday of -1 month

First month of last year: start month of -1 year

End of last month: end day of -1 month

First workday at the end of last month: end day_workday of -1 month

Last month of last year: end month of -1 year

Single Date

Definition

type = RELATIVE_DATE

expr = -1 year of 0 day

Example

Order count for last month: -1 month of 0 day