Determination of Previous-Year Values from Writeback Tables
Understand how weekly data for custom calendars is read from the Promotion Measure JSON or Account Measure Result JSON table.
Required Editions
Available in: Lightning Experience Available in: Enterprise and Unlimited Editions where Consumer Goods Cloud is enabled |
If a Read KPI is configured to read weekly data for custom calendars from the Promotion Measure JSON or Account Measure Result JSON table with a year offset, then the system calculates the corresponding data from the promotion and account writeback tables. The system performs 1:1 mapping for all periods. The period numbers act as the indexes of mapping. For example, value of P1 of the previous year becomes value of P1 of the current year. But the values of the first and last periods can vary if the number of days for the current and previous years vary.
Sometimes, when reading values with a year offset from custom calendars. For a successful configuration, in a custom calendar, always include custom periods that cover at least one complete year in the past. But when reading KPI values with a year offset, the system can read values that’s more than a year in the past. For example, if you calculate an account plan view for 2020 with a year offset of 2, then the system reads data from 2018. If no custom periods are defined for 2018, the calculation fails. So, when using KPIs with a year offset, ensure that the calendar years that are relevant for calculations are covered by custom periods.
Here are a few possible scenarios.
- Equal Number of Periods in the Current and Previous Year
- Here’s some sample data.

With the year offset to 1, values for 2021 are mapped to the corresponding periods for 2020. Because the number of periods is same in both the years, 1:1 mapping is possible without variations.
- Variations in the First Period
- Here’s the data for the month of January:
- Year offset = 1
- Weekday share profile = 1/n

With the year offset to 1, values for 2021 are mapped to the corresponding periods of 2020. The Read timeframe is the same for the current and previous years. Depending on the number of days in the current year period, values of corresponding periods are calculated by using the week day share profile.
P1 of 2020 includes only four days and these days aren’t part of the Read timeframe. So, the values for the days aren’t considered. The Read timeframe and P1 of 2021 start on January 06, 2021, but January 06 belongs to P2 of 2020. Based on 1:1 mapping, value of P2 in 2020 is mapped to the P2 in 2021. But P2 of 2020 starts on January 05, 2021, which isn’t a part of the Read timeframe. So, for 2021, here’s how the value of P2 is calculated:
- Based on 1/n profile, value of each weekday = Value of the corresponding period / Number of days in the period = 154 / 7 = 22.
- The Read timeframe consists of only six days of P2 in 2020. So, the value of this period = 22 × 6 = 132. This value is reflected in the P2 of 2021.
- Variations in the Last Period
- Here’s some sample data.

The number of periods in the past year is more than the number of periods in the future year. Except for the last period, 1:1 mapping is possible for all the periods of the future year. But because the number of periods is different for the two years, the value of the last period of the future year is the sum of all the remaining periods of the previous year. P50 of the future year = sum of values for P50 to P54 of the previous year = 60 + 30 + 60 + 30 + 60 = 240.
Note- If the number of periods in the future year is less than the number of periods in the past year, then the additional periods are left empty after 1:1 mapping of the available periods.
- When determining values with a year offset for a custom calendar, avoid large variations in the number of periods in the previous and current years.

