Time Functions
Time Functions and Pov Member References
When using the POV as a point of reference, use the following constants in the Member Scripts. In the constants below, N refers to the number of periods desired.
T#POV (All Dimension Types)
Select Members based on their literal or relative position to the selected main Point of View (POV) or the Cube View POV. The main POV settings are available under the OnePlace module. Call out a Dimension in order to pull its Member value from what is selected in the POV in this way: E#POV, C#POV, T#POV, V#POV, A#POV, and all other dimension types.
If a user's Cube POV is 2024M1, then a Cube View with T#POV returns 2024M1.
If the POV is 2024, T#POV returns 2024.
T#PovYear (Uses Time Member Suffix, e.g., T#PovYearM1)
This returns a specific time period within a current POV year defined by the currently selected POV period. If POV is 2024M1:
-
T#PovYear returns 2024
-
T#PovYearM3 returns 2024M3
You can combine T#PovYear with expansions. If the POV is 2024M3:
-
T#PovYear.HalfYears returns the 2024H1 and 2024H2
-
T#PovYear.Quarters returns all quarters for 2024
-
T#PovYear.Months returns all months for 2024
-
T#PovYear.Weeks returns all weeks for 2024 in weekly applications
T#PovPriorYear (Uses Time Member Suffix, e.g., T#PovPrior YearM12)
This returns a specific time period within the prior year defined by the currently selected POV period. If POV is 2024M1:
-
T#PovPriorYear returns 2023
-
T#PovPriorYearm12 returns 2023M12
T#PovPriorinYear1 (Uses Integer Suffix, e.g., T#PovPriorInYear1)
This returns the relative prior period from the currently selected POV period, but within the same year. If the current period is 2024M8:
-
T#PovPriorInYear4 returns 2024M4
-
T#PovPriorInYear10 returns the first period in the year, 2024M1, as there are not 10 periods prior to 2024M8 within the same year
T#PovPrior1 (Uses Integer Suffix, e.g. T#PovPrior1)
This returns the relative prior period from the currently selected POV period. If the POV is 2024M1, T#PovPrior3 returns 2023M10.
T#PovNextInYear1 (Uses Integer Suffix, e.g., T#PovNextInYear2)
This returns the relative next period in the future from the currently selected POV period, but within the same year. If the current period is 2024M4:
-
T#PovNextInYear5 returns 2024M9
-
T#PovNextInYear10 returns the last period in the year 2024M12, as there are not 10 periods after 2024M4 in within the same year.
T#PovNext1 (Uses Integer Suffix, e.g., T#PovNext1)
This returns the relative next period from the currently selected POV period. If the POV is 2024M8, T#PovNext5 returns 2025M1.
T#PovFirstInYear
This returns the first period in the year portion of the POV period. It is the same as T#POVM1, T#POVQ1, or, T#POVH1 based on the Input Frequency setting of the given Scenario. T#M1, T#Q1, or, T#H1 work the same way as well.
-
If the POV is 2024M2, T#PovFirstInYear returns 2024M1.
-
If the POV is 2024Q2, T#PovFirstInYear returns 2024Q1.
T#PovLastInYear
This returns the last period in the year portion of the POV period.If the current period is 2024M1, T#PovLastInYear returns 2024M12.
T#POVFirstInMonthPrior1
POV Month Example
This refers to the POV month and returns N months prior. If the POV is 2024M10, and T#POVFirstInMonthPrior5 is requested, 2024M5 is returned.
POV Week Example
This refers to the POV week and goes back N weeks from the first week in that month. This varies by calendar (445, 454, 544).
If the POV is 2024W38 (M9) in a 52 week 445 calendar, T#PovFirstInMonthPrior5 returns 2024W30. This example's result is driven by the first week in M9, which is 2024W35, and then returns five periods prior to 2024W30.
T#PovFirstInQuarterPrior1 (Uses Integer Suffix, e.g., T#PovFirstInQuarterPrior 1)
This refers to the POV sub-period’s quarter and goes back N periods from the first period in that quarter. If the period is 2024M5, T#PovFirstInQuarterPiror2 returns 2024M2. This example's result is driven by the first period in the requested quarter, which is 2024M4, and then returns two periods prior to 2024M2.
T#PovFirstInHalfYearPrior1 (Uses Integer Suffix, e.g., T#Pov FirstInHalfYearPrior2)
This refers to the POV sub-period’s half year and goes back N periods from the first period in that half year.
If the period is 2024M5, T#PovFirstInHalfYearPrior2 returns 2023M11. This example's result is driven by the first period in the half year requested, which is 2024M1, and then returns two periods prior to 2023M11.
T#PovFirstInYearPrior1 (Uses Integer Suffix, e.g., T#Pov FirstInYearPrior3)
This refers to the POV year and goes back N periods from the first period.
If the period is 2024M5, T#PovFirstInYearPrior1 returns 2023M12. This example's result is driven by the first period in the year requested, which is 2024M1, and then returns one period prior to 2023M12.
T#PovLastInYearPrior1 (Uses Integer Suffix, e.g., T#PovLastInYearPrior4)
This refers to the POV year and goes back N periods from the last period.
If the period is 2024M5, T#PovLastInYearPrior1 returns 2024M11. This examples result is driven by the last period in the year requested, which is 2024M12 and then returns one period prior from this period to 2024M11.
Time Functions and Workflow References
T#WF (e.g., T#WF or S#WF)
This refers to the time period or Scenario currently selected in the Workflow module. Examples are T#WF and S#WF.
-
If the Workflow POV is 2024 M1, T#WF returns 2024M1.
-
If the Workflow POV is Actual, S#WF returns Actual.
T#WFYear (Uses Time Member Suffix, e.g., T#WFYearM1)
This returns a specific time period within the current Workflow year. If the Workflow period is 2024M1:
-
T#WFYear returns 2024
-
T#WFYearM3 returns 2024M3
T#WFPriorInYear1 (Uses Integer Suffix, e.g., T#WFPriorInYear1)
This returns the relative prior period from the currently selected Workflow period, but within the same year. If the current Workflow period is 2024M8:
-
T#WFPriorInYear4 returns 2024M4
-
T#WFPriorInYear10 returns the first period in the year, 2024M1, as there are not 10 periods prior to 2024M8 within the same year
T#WFPrior1 (Uses Integer Suffix, e.g., T#WFPrior2)
This returns the relative prior period to the current Workflow period. If the current Workflow period is 2024M1, T#WFPrior3 returns 2023M10.
T#WFNextInYear1 (Uses Integer Suffix, e.g., T#WFNextInYear1)
This returns the relative next period in the future from the currently selected Workflow period, but within the same year. If the current Workflow period is 2024M4:
-
T#WFNextInYear5 returns 2024M9
-
T#WFNextInYear10 returns the last period in the year, 2024M12, as there are not 10 periods after 2024M4 within the same year.
T#WFNext1 (Uses Integer Suffix, e.g., T#WFNext 2)
This returns the relative next period to the current Workflow period. If the current Workflow period is 2024M8, T#WFNext5 returns 2025M1.
T#WFFirstInYear
This returns the first period in the year portion of the Workflow period. This is the same as T#WFM1, T#WFQ1, or T#WFH1 based on the Input Frequency settings of the given Scenario.
-
If the current Workflow period is 2024M2, T#WFFirstInYear returns 2024M1.
-
If the current Workflow period is 2024Q2, T#WFFirstInYear returns 2024Q1.
T#WFLastInYear
This returns the last period in the year portion of the Workflow period. If the current Workflow period is 2024M1, T#WFLastInYear returns 2024M12.
Time Functions and Global References
T#Global (e.g., T#Global or S#Global)
The Application has a Global Time and Global Scenario setting found under the Application Tab > Tools > Application Properties. These settings can be referenced, for example T#Global and S#Global. For example, T#Global can be referenced in a Cube View's columns where everything before T#Global appears as the Actual scenario, and everything after T#Global appears as the Forecast scenario.
If the Global POV is 2024M1, T#Global returns 2024M1.
If the Global POV is Actual, S#Global returns Actual.
T#GlobalYear (Uses Time Member Suffix, e.g., T#GlobalYearM1)
This returns a specific time period within the current Global year. If the Global period is equal to 2024M1:
-
T#GlobalYear returns 2024
-
T#GlobalYearM3 returns 2024M3
T#GlobalPriorInYear1 (Uses Integer Suffix, e.g., T#GlobalPriorInYear1)
This returns the relative prior period from the currently selected Global period, but within the same year. If the current Global POV period is 2024M8:
-
T#GlobalPrioriInYear4 returns 2024M4
-
T#GlobalPriorInYear10 returns the first period in the year, 2024M1, as there are not 10 periods prior to 2024M8 within the same year.
T#GlobalPrior1 (Uses Integer Suffix, e.g., T#Global Prior 3)
This returns the relative prior period to the current Global period. If the current Global period is 2024M1, T#GlobalPiror3 returns 2023M10.
T#GlobalNextInYear1 (Uses Integer Suffix, e.g., T#GlobalNextInYear5)
This returns the relative next period in the future from the currently selected Global POV period, but within the same year. If the current Global POV period is 2024M4:
-
T#GlobalNextInYear5 returns 2024M9
-
T#GlobalNextInYear10 returns the last period in the year, 2024M12, as there are not 10 periods after 2024M4 within the same year.
T#GlobalNext1 (Uses Integer Suffix, e.g., T#GlobalNext5)
This returns the relative next period to the current Global period. If the current Global period is 2024M8, T#GlobalNext5 returns 2025M1.
T#GlobalFirstInYear
This returns the first period in the year portion of the Global period. This is the same as T#GlobalM1, T#GlobalQ1, or T#GlobalH1 based on the Input Frequency setting of the given Scenario.
-
If the current Global period is 2024M2, T#GlobalFirstInYear returns 2024M1.
-
If the current Global period is 2024Q21, T#GlobalFirstInYear returns 2024Q1.
T#GlobalLastInYear
This returns the last period in the year portion of the Global period. If the current Global period is 2024M1, T#GlobalLastInYear returns 2024M12.
For more Time Function examples, refer to the Samples Tab in the Member Filter Builder.
Time Functions and General References
Time functions, such as T#Year(|!MyTimeParam!|), return values based on what is within the parentheses, such as a parameters, substitution variables, and time members. For example, a user can select a time member from a Parameter prompt, such as 2024M6.
With these time functions, reference the year separate from the sub-period wherever T# is used. The following examples use parameters and substitution variables.
This example uses a Parameter named MyTimeParam.
The Cube View can use the selection like this:
-
T#Year(|!MyTimeParam!|)Period(|!MyTimeParam!|)
The Year function returns the specified year, and the Period function returns the period without the year. The result is a valid time member because they are combined.
If the user selected 2024M6, it looks like this after the Parameter substitution:
-
T#Year(2024M6)Period(2024M6)
The result used in the Cube View is T#2024M6.
This example shows last year’s values for the same month. If the user selects 2024M6:
-
T#YearPrior1(|!MyTimeParam!|)Period(|!MyTimeParam!|) returns T#2023M6.
This example shows last month’s values for the same year. If the user selects 2024M6:
-
T#Year(|!MyTimeParam!|)PeriodPrior1(|!MyTimeParam!|) returns T#2024M5.
This example shows all base members for the year using a Member Expansion:
-
T#Year(|!MyTimeParam!|).Base
These examples look at the user’s POV using a substitution variable. If the user’s POV is 2024M1:
-
T#Year(|POVTime|)PeriodNext1(|POVTime|) returns 2024M2.
-
T#YearPrior2(|POVTime|)Period(|POVTime|) returns 2022M1.
-
T#YearNext2(|POVTime|)Period(|POVTime|) returns 2026M1.
-
T#Year(|POVTime|)Quarter(|POVTime|).MonthsInQuarter returns 2024M1, 2024M2, and 2024M3.
This example looks at the Workflow POV Time member and then counts back two years prior, such as when viewing prior year’s YTD Net Income Values. If the Workflow time is 2024M1, T#YearPrior2(|WFTime|) returns 2022.
This example looks at the Global POV Time member and then counts forward 3 years. If the Global Time is 2024M3, T#YearNext3(|GlobalTime|) returns 2027.
Here are additional examples for each General Time Function, which return values based on the parameters, substitution variables, and time members within the parentheses.
T#Year():
This returns the year. If a period is specified after, it returns the year and then the specified period. If the Year section is skipped, the year comes from the Period section. Below are examples:
T#Year(|!TimeParam!|)Period(|!TimeParam!|)
-
T#Year(2024M6) returns 2024.
-
T#Year(2024M6)Period(2024M6) returns 2024M6.
-
T#Year(2024M6)M2 returns 2024M2.
-
T#Year(2024M6)PeriodPrior3(2024M6) returns 2024M3.
-
T#Year(2024M6)PeriodPrior8(2024M6) returns 2023M10. PeriodPrior8 caused the year to change.
-
T#Year(2024M6)PeriodPriorInYear8(2024M6) returns 2024M1. PeriodPriorInYear8 does not change the year, and returns M1 as there are not 8 periods prior to M6 in the year.
T#YearPrior1():
This returns a prior year based on the number in the function. If a period is specified after, it returns the prior year and then the specified period.
-
T#YearPrior2(2024M6) returns 2022.
-
T#YearPrior1(2024M6)Period(2024M6) returns 2023M6.
-
T#YearPrior2(2024M6)Period(2024M6) returns 2022M6.
T#YearNext1():
This returns a future year based on the number in the function. If a period is specified after, it returns the future year and then the specified period.
-
T#YearNext2(2024M6) returns 2026.
-
T#YearNext1(2024M6)Period(2024M6) returns 2025M6.
T#Period():
This returns the period and year. The year comes from the period section if the Year() section is skipped.
-
T#Period(2024M6) returns 2024M6.
T#PeriodPrior1():
This returns the relative prior period based on the number in the function. The year comes from the relative prior period.
T#PeriodPrior3(|WFTime|)
-
T#PeriodPrior3(2024M6) returns 2024M3.
-
T#PeriodPrior8(2024M6) returns 2023M10.
T#PeriodNext1():
This returns the relative future period based on the number in the function. The year comes from the relative future period.
T#PeriodNext2(|GlobalTime|)
-
T#PeriodNext2(2024M6) returns 2024M8.
-
T#PeriodNext8(2024M6) returns 2025M2.
T#PeriodPriorInYear1():
This returns the relative prior period within the same year based on the number in the function. The year comes from the period section.
-
T#PeriodPriorInYear2(2024M6) returns 2024M4.
-
T#PeriodPriorInYear8(2024M6) returns 2024M1. This returns the first period in the year, M1, as there are not 8 periods prior to M6 in the same year.
T#PeriodNextInYear1():
This returns the relative future period within the same year based on the number in the function. The year comes from the period section.
T#PeriodNextInYear1(|GlobalTime|)
-
T#PeriodNextInYear1(2024M6) returns 2024M7.
-
T#PeriodNextInYear8(2024M6) returns 2024M12. This returns the last period in the year, M12, as there are not 8 periods after M6 in the same year.
T#FirstPeriodInQuarter():
This returns the first period in the quarter. The year comes from the period section.
T#FirstPeriodInQuarter(|WFTime|)
-
T#FirstPeriodInQuarter(2024M6) returns 2024M4.
-
T#FirstPeriodInQuarter(2024M2) returns 2024M1.
T#FirstPeriodInQuarterPrior1():
This looks at the first period in the quarter, and then it returns the relative prior period based on the number in the function. The year comes from the relative prior period.
-
T#FirstPeriodInQuarterPrior1(2024M6) returns 2024M3. The first period in the quarter is 2024M4, and then 1 period prior is M3.
-
T#FirstPeriodInQuarterPrior4(2024M6) returns 2023M12. The first period in the quarter is 2024M4, and then 4 periods prior is 2023M12.
T#FirstPeriodInQuarterNext1():
This looks at the first period in the quarter, and then it returns the relative future period based on the number in the function. The year comes from the relative future period.
T#FirstPeriodInQuarterNext2(|POVTime|)
-
T#FirstPeriodInQuarterNext2(2024M6) returns 2024M6. The first period in the quarter is 2024M4, and then 2 periods in the future is M6.
-
T#FirstPeriodInQuarterNext9(2024M6) returns 2025M1. The first period in the quarter is 2024M4, and then 9 periods in the future is 2025M1.
T#FirstPeriodInHalfYear():
This returns the first period in the half year. The year comes from the period section.
T#FirstPeriodInHalfYear(|WFTime|)
-
T#FirstPeriodInHalfYear(2024M6) returns 2024M1.
T#FirstPeriodInHalfYearPrior1():
This looks at the first period in the half year. Then it returns the relative prior period based on the number in the function. The year comes from the relative prior period.
-
T#FirstPeriodInHalfYearPrior1(2024M6) returns 2023M12. The first period in the half year is 2024M1, and then 1 period prior is 2023M12.
T#FirstPeriodInHalfYearNext1():
This looks at the first period in the half year, and then it returns the relative future period based on the number in the function. The year comes from the relative future period.
T#FirstPeriodInHalfYearNext2(|WFTime|)
-
T#FirstPeriodInHalfYearNext2(2024M6) returns 2024M3. The first period in the half year is 2024M1, and then 2 periods in the future is M3.
T#FirstPeriodInYear():
This returns the first period in the year. The year comes from the period section.
T#FirstPeriodInYear(|WFTime|)
-
T#FirstPeriodInYear(2024M6) returns 2024M1.
T#FirstPeriodInYearPrior1():
This looks at the first period in the yearand then it returns the relative prior period based on the number in the function. The year comes from the relative prior period.
T#FirstPeriodInYearPrior1(|!TimeParam!|)
-
T#FirstPeriodInYearPrior1(2024M6) returns 2023M12. The first period in the year is 2024M1, and then 1 period prior is 2023M12.
T#FirstPeriodInYearNext1():
This looks at the first period in the year, andthen it returns the relative future period based on the number in the function. The year comes from the relative future period.
T#FirstPeriodInYearNext2(|PovTime|)
-
T#FirstPeriodInYearNext2(2024M6) returns 2024M3. The first period in the half year is 2024M1, and then 2 periods in the future is M3.
T#Quarter():
This returns the quarter. The year comes from the period section.
T#Quarter(|WFTime|).
-
T#Quarter(2024M6) returns 2024Q2.
-
T#Quarter(2024M1) returns 2024Q1.
T#QuarterPrior1():
This returns the relative prior quarter based on the number in the function. The year comes from the relative prior quarter.
-
T#QuarterPrior1(2024M6) returns 2024Q1.
-
T#QuarterPrior3(2024M6) returns 2023Q3.
T#QuarterNext1():
This returns the relative future quarter based on the number in the function. The year comes from the relative future quarter.
T#QuarterNext2(|POVTime|).
-
T#QuarterNext2(2024M6) returns 2024Q4.
-
T#QuarterNext3(2024M6) returns 2025Q1.
Weekly Functions
The following Time Functions apply to weekly applications. The following examples are based on a 52 Week 445 calendar.
T#FirstPeriodInMonth
If a weekly period is used in the function, this returns the first week in the month. The year comes from the period section.
-
T#FirstPeriodInMonth(2024W43) returns 2024W40.
T#FirstPeriodInMonthPrior1()
If a weekly period is used in the function, this looks at the first weekly period in the month. It then returns the relative prior weekly period based on the number in the function. The year comes from the relative prior period.
T#FirstPeriodInMonthPrior3(|WFTime|).
-
T#FirstPeriodInMonthPrior3(2024W5) returns 2024W2.
-
T#FirstPeriodInMonthPrior3(2024W1) returns 2023W50.
T#FirstPeriodInMonthNext1()
If a weekly period is used in the function, this looks at the first weekly period in the month. It then returns the relative future weekly period based on the number in the function. The year comes from the relative future period.
-
T#FirstPeriodInMonthNext2(2024W49) returns 2024W50. The first weekly period in the month is 2024W48, and then 2 periods after is 2024W50.
-
T#FirstPeriodInMonthNext2(2024W52) returns 2024W50. The first weekly period in the month is 2024W48, and then 2 periods after is 2024W50.
T#Month()
This returns the month. The year comes from the period section.
-
T#Month(2024W40) returns 2024M10.
T#MonthPrior1()
This returns the relative prior month based on the number in the function. The year comes from the relative prior month.
-
T#MonthPrior1(2024W5) returns 2024M1.
-
T#MonthPrior2(2024W5) returns 2023M12.
T#MonthNext1()
This returns the relative future month based on the number in the function. The year comes from the relative future month.
T#MonthNext5(|POVTime|).
-
T#MonthNext5(2024W9) returns 2024M8.
-
T#MonthNext2(2024W52) returns 2025M2.
Changing the Time Label in Headers When Using These Time Functions
When using this Time function to change a header label in a Cube View, use the :Name(“”) function and substitute what is seen.
The following example shows what a Time function returns in the header of a Cube View without and with a :Name(ʺʺ) function. The Time function below returns the last period of the prior year using the Global Time period. For this example, the Global Time is 2024M6 and the |MFYear| substitution variable is the Member Filter’s year:
T#YearPrior1(|GlobalTime|)M12 returns 2023M12 - Dec 2023 (dependent on the Cube View Header Text properties).
T#YearPrior1(|GlobalTime|)M12:Name(ʺYear End |MFYear|ʺ) returns Year End 2023.
Below are examples of what similar substitution variables return if Global Time is 2024M6:
-
T#YearPrior1(|GlobalTime|)M12:Name(ʺYear End |MFTime|ʺ) returns Year End 2023M12.
-
T#YearPrior1(|GlobalTime|)M12:Name(ʺYear End |MFTimeDesc|ʺ) returns Year End Dec 2023.
-
T#YearPrior1(|GlobalTime|)M12:Name(ʺYear End |MFTimeShortDesc|ʺ) returns Year End Dec.
-
T#YearPrior1(|GlobalTime|)M12:Name(ʺYear End |MFSubPeriod|ʺ) returns Year End M12.