In this article
Filter report content and monitor metrics with time ranges using absolute or relative dates. Time range units are year, quarter, month, week, and day.
Time ranges enable the end-user to filter the report content and monitor and analyze changes in critical metrics over time by comparing the current period values to the previous period values. Time ranges can be defined using absolute dates or relative dates based on time periods.
Studio supports the following time range units:
Year
Quarter
Month
Week
Day
Time ranges can be defined at the report level and utilized in filter definitions. The syntax for expressions with absolute dates for time periods is as follows:
InPeriod(date, n_start, n_end, ref_date)
where
"Period" refers to a time period, such as a month.
"Date" refers to a time variable being evaluated against the range.
"n_start" represents the number of time periods in relation to the reference date that define the start date of the range.
"n_end" represents the number of time periods in relation to the reference date that define the end date of the range.
"Ref_date" refers to the reference date.
The syntax for expressions with absolute dates for time periods is as follows:
"Between(date, start_date, end_date)"
These expressions evaluate to true if the specified date falls within the specified range of periods relative to the specified start date. The start date defaults to the current date, resulting in a rolling period.
currentPeriod: between(survey:interview_start, 2019-07-01, 2019-08-31) previousPeriod: between(survey:interview_start, 2019-05-01, 2019-06-30) // In period with explicit start date // currentPeriod: InMonth(survey:interview_start, -1, 0, 2019-08-01) // previousPeriod: InMonth(survey:interview_start, -3, -2, 2019-08-01) // rolling period //currentPeriod: InMonth(survey:interview_start, -21, -20) //previousPeriod: InMonth(survey:interview_start, -23, -22) // same months 2 years ago //currentPeriod: InMonth(survey:interview_start, 0, 3) //previousPeriod: InMonth(AddYear(survey:interview_start, 2), 0, 3) // Period to current date //currentPeriod: YearToDate(survey:interview_start) //previousPeriod: InYear(survey:interview_start, -2, -1)