Description | The |
Syntax | TIME_PERIOD( |
Output | text |
Variables
date
: The date or datetime field for which you want to determine the time period."day"/"week"/"month"/"quarter"/"year": Specifies the standard time period.
The “week” time period groups from Monday to Sunday.
Example 1
TIME_PERIOD(`Sale Date`, 'year')
Transaction | Sale Date | TIME_PERIOD(year) |
Transaction A | 2023-09-10 | 2023 |
Transaction B | 2023-08-25 | 2023 |
Transaction C | 2023-09-01 | 2023 |
Example 2
TIME_PERIOD(`Sale Date`, 'quarter')
Transaction | Sale Date | TIME_PERIOD(quarter) |
Transaction A | 2023-09-10 | 2023 Q3 |
Transaction B | 2023-08-25 | 2023 Q3 |
Transaction C | 2023-09-01 | 2023 Q3 |
Example 3
TIME_PERIOD(`Sale Date`,'month')
Transaction | Sale Date | TIME_PERIOD(month) |
Transaction A | 2023-09-10 | 2023-09 |
Transaction B | 2023-08-25 | 2023-08 |
Transaction C | 2023-09-01 | 2023-09 |
Example 4
TIME_PERIOD(`Sale Date`,'week')
Transaction | Sale Date | TIME_PERIOD(week) |
Transaction A | 2023-09-10 | 2023-09-04 |
Transaction B | 2023-08-25 | 2023-08-21 |
Transaction C | 2023-09-01 | 2023-08-28 |
Example 5
TIME_PERIOD(`Sale Date`,'day')
Transaction | Sale Date | TIME_PERIOD(day) |
Transaction A | 2023-09-10 | 2023-09-10 |
Transaction B | 2023-08-25 | 2023-08-25 |
Transaction C | 2023-09-01 | 2023-09-01 |