Description | The |
Syntax | TIME_PERIOD_OFFSET( |
Output | integer |
Variables
date
: The date for which you want to calculate the time period offset."day"/"week"/"month"/"quarter"/"year"/"decade": The time period to use for calculating the offset.
Example 1
TIME_PERIOD_OFFSET(`Event Date`,"day")
Event | Event Date | TIME_PERIOD_OFFSET(day) |
Event A | September 10, 2023 | −29 |
Event B | February 25, 2024 | 139 |
Event C | December 1, 2023 | 53 |
Event D | April 15, 2022 | −542 |
Example 2
TIME_PERIOD_OFFSET(`Event Date`,"week")
Event | Event Date | TIME_PERIOD_OFFSET(week) |
Event A | September 10, 2023 | −5 |
Event B | February 25, 2024 | 19 |
Event C | December 1, 2023 | 7 |
Event D | April 15, 2022 | −78 |
Example 3
TIME_PERIOD_OFFSET(`Event Date`,"month")
Event | Event Date | TIME_PERIOD_OFFSET(month) |
Event A | September 10, 2023 | −1 |
Event B | February 25, 2024 | 4 |
Event C | December 1, 2023 | 2 |
Event D | April 15, 2022 | −18 |
Example 4
TIME_PERIOD_OFFSET(`Event Date`, "quarter")
Event | Event Date | TIME_PERIOD_OFFSET(quarter) |
Event A | September 10, 2023 | −1 |
Event B | February 25, 2024 | 1 |
Event C | December 1, 2023 | 0 |
Event D | April 15, 2022 | −6 |
Example 5
TIME_PERIOD_OFFSET(`Event Date`,"year")
Event | Event Date | TIME_PERIOD_OFFSET(year) |
Event A | September 10, 2023 | 0 |
Event B | February 25, 2024 | 1 |
Event C | December 1, 2023 | 0 |
Event D | April 15, 2022 | −1 |
Example 6
TIME_PERIOD_OFFSET(`Event Date`,"decade")
Event | Event Date | TIME_PERIOD_OFFSET(decade) |
Event A | September 10, 2023 | 0 |
Event B | February 25, 2024 | 0 |
Event C | December 1, 2023 | 0 |
Event D | April 15, 2022 | 0 |
*Examples As of September 22, 2023