Custom Boundary on date dataelement

I need to write a Program indicator that use a custom boundary. This boundary use a date data element.
for example (I would like to count all the events that occurred within the custom boundary period).
I put as in the image:

When i running my indicator i get this error: invalid input syntax for type timestamp

1 Like

Hi @simone !

It looks like youve attempted to use custom analytics period boundaries with a data element of type DATETIME, which is causing the error. This reproduces on 2.35.1 play as well and appears to be a bug, could you please open a ticket on JIRA?

As a solution, you could try a period indicator with no analytics period boundaries, but use event type and event count expression, with this filter:
d2:daysBetween(V{analytics_period_start}, #{uvMKOn1oWvd.tz1T2EbIOWq})>=0 && d2:daysBetween(#{uvMKOn1oWvd.tz1T2EbIOWq}, V{analytics_period_end})>=0
where #{uvMKOn1oWvd.tz1T2EbIOWq} is your DATETIME data element.

For reproducible example: I downloaded the metadata for this test from:
If you import the metadata file below back into the system, add a value for “datetime” data element (in program Malaria Focus Investigation, Stage Foci response), then run analytics, you should be able to see a value at this link.

1 Like

Hi Brian,

Many thanks, this is a fantastically useful workaround. My problem is different (Event Reports line listings don’t appear to be honouring the analytics period boundaries, so I’m getting different results from pivot tables vs Event Reports line listings!), but this workaround has resolved it beautifully, and both are now generating the same figures.

Cheers, Sam.


Can anyone confirm if a JIRA ticket was opened for this issue?
We are experiencing a similar issue. In our case, we have one analytics period boundary with many DEs as filter but no DATETIME data elements in custom boundaries or filter

It appears Simone’s question was not converted into a Jira ticket, so I have just created one here. @simone Please provide additional comments for your use case if needed.

Regarding your use case, do you mind sharing more details? Which version, what is the expected behavior, and is this a workaround for a missing feature regarding DATETIME data elements?

If you have one analytics period boundary, you can add a second one to close the boundary window for event or enrollment to be included in the program indicator. One-sided boundaries will typically result in “cumulative” counts.

1 Like

Hi @brian,

Can you please explain to me a bit more about (V{analytics_period_start} and V{analytics_period_end} in the expression below?

In a tracker program, first I used the default report date below to capture the date each event (programme stage) happened

, but I am not able to show the report date next to the data in the event reports application, so I created a date data element to achieve this. But I read that program indicators use the event date (report date) for aggregation.

Other inputs will really be useful.


Thank you @Brian.

1 Like