Hi @jthomas, Actually, the .periodOffset() function is only valid for indicators, not for predictors. It may be that the most effective way for you to get what you want is to just create an indicator with exactly the same expression shown in your screen shot.
If you want to compute the same value using a predictor, you could do it with a predictor generator expression such as:
Any value within an aggregation function such as sum() means to get the value from past sampled periods, whereas a value outside the aggregation function means to get the value from the same period that you are predicting for. Then you could define the predictor with a sequential sample count of 5, but a sequential skip count of 4. (Look at the last five years, but not a the most recent 4 of these.) This means that the value inside sum() is looking only a the single value from 5 years ago.
But my guess is that your best option may be to use the .periodOffset() function within an indicator.
This assumes that the data is stored with a periodType of Yearly.
Finally, our apologies that the .periodOffset() function was even considered valid within a predictor expression. This is a bug. It should only be valid within an indicator expression. I have created a Jira ticket for this: DHIS2-12258.