Use the Accounting Calendar Time Periods for Your Rollups

When creating rollups that depend on fiscal year periods, such as current quarter, use the accounting calendar periods. The accounting calendar defines the fiscal year and the time periods within it.

Therefore, the periods that are set based on the accounting calendar are useful when calculating rollups like Revenue from the last fiscal quarter.

In the sales application, predefined period tokens are available that are created based on the accounting calendar time periods.

Accounting Calendar Period Tokens for Rollups

This table lists the period tokens based on the accounting calendar. You use the tokens given in the Token column to define the periods for your rollups.

Note: Ensure that your accounting calendar supports weekly periods before using the week-related tokens for rollups. The week-related tokens are: GLWTD, GLPWTD, and GLPW.

Accounting Calendar Period Tokens

# Token Meaning Attribute Description
1 GLWTD Week-to-date glweekToDate() The period from the beginning of the current week until today. For example, the current date is Thursday, March 10, and the first day of the week is set in the accounting calendar as Monday. The week-to-date period will be from Monday, March 7, to Thursday, March 10.
2 GLMTD Month-to-date glmonthToDate() The period from the first day of the current month until today. For example, the current date is March 10. The month-to-date period will be March 1 to 10.
3 GLQTD Quarter-to-date glquarterToDate() The period from the first day of the current quarter until today. For example, if the first day of the current quarter is January 1 and the current date is March 10, the quarter-to-date period will be January 1 to March 10.
4 GLYTD Year-to-date glyearToDate() The period from the first day of the current fiscal year until today. For example, if the first day of your current fiscal year is January 1, the year-to-date period will be January 1 to March 10.
5 GLPWTD Previous Week-to-date glpreviousWeekToDate() The period from the first day of the previous week until today. For example, if the week begins on Monday, the previous week-to-date period will be from Monday of the last week until today.
6 GLPMTD Previous Month-to-date glpreviousMonthToDate() The period from the first day of the previous month until today. For example, if the current date is March 10, the previous month-to-date period will be February 1 to March 10.
7 GLPQTD Previous Quarter-to-date glpreviousQuarterToDate() The period from the first day of the previous quarter until today. For example, if the first day of the previous quarter was October 1, 2021, and the current date is March 10, 2022, the previous quarter-to-date period will be October 1, 2021, of the previous year, to March 10, 2022.
8 GLPYTD Previous Year-to-date glpreviousYearToDate() The period from the first day of the previous fiscal year until today. For example, if the first day of your previous fiscal year was January 1, 2021, the year-to-date period will be January 1, 2021, to March 10, 2022.
9 GLPW Previous Week glpreviousWeek() The period from the first day of the previous week until the end of the week.
10 GLPM Previous Month glpreviousMonth() The period from the first day of the previous month until the end of the month.
11 GLPQ Previous Quarter glpreviousQuarter() The period from the first day of the previous quarter until the end of the quarter.
12 GLPY Previous Year glpreviousYear() The period from the first day of the previous fiscal year until the end of the fiscal year.
13 GLCQ Current Quarter glcurrentQuarter() The period from the first day of the current quarter until the end of the quarter.
14 GLNQ Next Quarter glnextQuarter() The period from the first day of the next quarter until the end of the next quarter.

Date Filters

Here's a list of the regular date filters that you can use for rollups:

Date Filter Tokens

# Token Meaning Description
1 WTD Week-to-date The period from the beginning of the current week until today. For example, the current date is Thursday, March 10, and the first day of the week is set in the accounting calendar as Monday. The week-to-date period will be from Monday, March 7, to Thursday, March 10.
2 MTD Month-to-date The period from the first day of the current month until today. For example, the current date is March 10. The month-to-date period will be March 1 to 10.
3 QTD Quarter-to-date The period from the first day of the current quarter until today. For example, if the first day of the current quarter is January 1 and the current date is March 10, the quarter-to-date period will be January 1 to March 10.
4 YTD Year-to-date The period from the first day of the current fiscal year until today. For example, if the first day of your current fiscal year is January 1, the year-to-date period will be January 1 to March 10.
5 PWTD Previous Week-to-date The period from the first day of the previous week until today. For example, if the week begins on Monday, the previous week-to-date period will be from Monday of the last week until today.
6 PMTD Previous Month-to-date The period from the first day of the previous month until today. For example, if the current date is March 10, the previous month-to-date period will be February 1 to March 10.
7 PQTD Previous Quarter-to-date The period from the first day of the previous quarter until today. For example, if the first day of the previous quarter was October 1, 2021, and the current date is March 10, 2022, the previous quarter-to-date period will be October 1, 2021, of the previous year, to March 10, 2022.
8 PYTD Previous Year-to-date The period from the first day of the previous fiscal year until today. For example, if the first day of your previous fiscal year was January 1, 2021, the year-to-date period will be January 1, 2021, to March 10, 2022.
9 PW Previous Week The period from the first day of the previous week until the end of the week.
10 PM Previous Month The period from the first day of the previous month until the end of the month.
11 PQ Previous Quarter The period from the first day of the previous quarter until the end of the quarter.
12 PY Previous Year The period from the first day of the previous fiscal year until the end of the fiscal year.
13 NEXT_30DAYS Next 30 Days The period from Today until next 30 days.
14 PAST_30DAYS Past 30 Days The period from Past 30 days until Today.
15 NEXT_60DAYS Next 60 Days The period from Today until next 60 days.
16 PAST_60DAYS Past 60 Days The period from Past 60 days until Today.
17 NEXT_90DAYS Next 90 Days The period from Today until next 90 days.
18 PAST_90DAYS Past 90 Days The period from Past 90 days until Today.
19 CURRENT_QTR Current Quarter The period from first day of the current quarter to the last day of the current quarter.
20 NEXT_QTR Next Quarter The period from first day of the next quarter to the last day of the current quarter.
21 TODAY Today Current day.
22 NOW Current time Current time.

How to Use an Accounting Calendar Token in a Rollup

When creating a rollup, you write a query into the Related Object Filter field, defining all the conditions that a rollup needs to consider while calculating the aggregated value. For example, you want to create a rollup that calculates revenue from qualified and unqualified leads. In this case, your Source Object is Account, the Related Object is Lead, and the Related Object Filter query is:

StatusCode IN ('QUALIFIED', 'UNQUALIFIED') AND DEAL AMOUNT IS NOT NULL

This query adds up the revenue or deal amount associated with the qualified and unqualified leads and shows the aggregated value for the rollup.

Now, let’s say you want to calculate the revenue from the previous quarter of the accounting calendar. You need to add the period token, GL_PQ, to the query, as shown below:

StatusCode IN ('QUALIFIED', 'UNQUALIFIED') AND DEAL AMOUNT IS NOT NULL AND LastAssignmentDate=:GL_PQ