Period aggregation of last value (sum in org unit hierarchy) data elements not respecting ISO 8601 standard

Hello Community,

I’m having an issue when analyzing data from my data elements with last value (sum in org unit hierarchy) aggregation type in the data visualization app. These data elements are part of a weekly data set and data is being analyzed using both weekly and monthly periods.

When analyzing at the weekly level, everything works as expected.

However, when analyzing data for aggregated periods (monthly in my case), the app does not appear to follow the ISO 8601 week-to-month rule (i.e. a week is attributed to the month in which it has four or more days). Instead, weeks are being attributed according to the month the last day of the week falls in. This is not the expected output nor does it align with the DHIS documentation on how data should be aggregated across periods.

To demonstrate, I entered some dummy date, where each weekly value is equal to the ISO week number. For 2026, I observed 4 months (so far) where the displayed monthly value does not match the expected ISO week assignment. Instead, the monthly values appear to be from the last week ending in the corresponding month. See screenshots of my weekly and monthy data below - offending values are circled in red.


Has anyone run into this issue? Is this expected behavior?

I’m currently on version 2.42.5.1 but I also flagged this issue a few years ago on version 2.33.4 here

Hi @Kris_Reinhardt

Thank you for providing the screenshots they helped me understand what’s going on. I agree this seems to be a bug issue but I will first need to triage to @dhis2-analytics; however, you’re welcome to create a bug issue on Jira.

It seems like there was an exactly similar Jira bug issue in older versions that got fixed, please see Lars description here, Analytics: weeks to month - DHIS2-2769 , sound the same right?

Based on his explanation I think the screenshot should have shown for example for January the value should’ve been 5 (6 days in January Week 1 2025-01-26 - 2026-02-01)…etc

Thanks @Gassim for the reply :slight_smile:

The bug you flagged does seem to be related. However, the issue I’m having is only with data elements with the last value aggregation type. Other aggregation types we use for data elements, like sum or average, seem to be aggregating from week-to-month as expected.

I can create a ticket on JIRA for this issue, but it would be good to hear from @dhis2-analytics on the expected behavior since it seems like it’s been this way for several versions.

Thank you @Kris_Reinhardt! Your posts have been quite helpful. This topic has been triaged to dhis2-analytics team and @jason and @luciano reviewed the issue. Here’s the Jira bug ticket that Luciano created: Jira

Please feel free to review the ticket and add your comments directly. Thank you!

Awesome! The JIRA ticket looks comprehensive to me.

Thanks to all @Gassim @jason @luciano