Scheduling predictor Jobs to populate later months

Hello everyone,

I’m having trouble populating fields using a scheduled predictor job. The predictors work very fine when they are run on their own but there are thousands of them and it is just more efficient to use the scheduler app for this.

The datasets that is used is monthly and there are 3 predictor groups that are populated due to calculated values of it’s output data elements previous months. All 3 groups have been separated into 3 predictor jobs and out of these 3, 2 predictor group jobs are not populating.

Right now, configurations have been set to populate months from MARCH till present.The scheduler job settings are below:

  • CRON Expression - 0 30 0 1/25 * ? (Every 25 days)
  • Parameters
    • Relative start: -120
    • Relative end: 0
  • Predictor group: Opening Stock

Relative start is -120 because to the best of my knowledge, these periods are always in days, here is a link to documentation for quicker access: Scheduling - DHIS2 Documentation. If the configuration is not correct or if more information is required/questions, please don’t hesitate to comment.

Hi @WumiOjo,

Are you able to see any error logs in Network tab or in Catalina.out log?


Hi @Gassim,

Unfortunately I do not have have access to the server or database.

I can confirm though on version 2.38 that using a end period that is at 2 months before the scheduled day will populate the fields for those month. So if end period is say -67, and start date is -210 it will populate fields up to April. And leave out May and June.

Hi @WumiOjo,

As far as I can tell, your understanding is correct. For predictor scheduling, relative start and end are the number of days relative to the day on which the job is run.

I’m not a cron expert but I’m looking at your expression. I would think the cron job would execute on the 1st of every month and then 25 days later, so also on the 26th of every month? Is this what you intend? Or do I not understand cron jobs well enough? (That is certainly possible!)

So if your job runs on July 1 and the predictors are monthly (is that true?), it should predict for any months starting at most 120 days previous (March 3), and ending at most 0 days relative (July 1). So it should predict for April, May, and June. When it runs again on July 26, it should predict for months starting at most 120 days previous (March 28), and ending at most 0 days relative (July 26). So it would again predict for April, May, and June.

That is what I would expect. With more information I might be able to comment further.


@Jim_Grace, yes the predictors were set to run 25 days from the day they were created but they have been updated now to just the 25th of every month to avoid unforseen complications.

Initially i was unable to populate fields using an end period that exceeds 2 months.

Unfortunately I don’t have immediately access to the logs for instance but while scheduler works perfectly, the end period seem to work only within a certain limit. If the following settings are used:

  • CRON Expression - 0 30 0 25 * ? (Every 25th)
  • Parameters
    • Relative start: -210
    • Relative end: -180
  • Predictor group: Opening Stock

Instead of populating the fields from January, it doesn’t. But if a relative period of -69 (2 months from today) is used, the fields are populated, leaving out May and June.

It makes sense that the scheduler app should be used to populate most recent fields so relative end shouldn’t be so far from the presentdate. I was mostly just testing the functionalities of the scheduler application, its not required to run fields for just January.

If of course the application is not supposed to work this way, I’d love to have a more accurate understanding.

1 Like

Hi @WumiOjo. I’m very sorry that it has taken me so long to respond; I was on vacation and I lost track of this issue. It may be most helpful if you say what you are trying to do. For example, if you run the predictors on the 25th of August, which months do you want to cover? Then I might be able to best advise you and explain how it works.