Data analysis: difference between last month and last three months


(Jaime Bosque) #1

Hello!

We have realized that while doing data analysis via the Pivot Tables there seems to be an error while using the time dimension.

When selecting Last 3 months, we get the following table:
image

But when selecting only January (via Last month) we get the following table:
image

It seems that these numbers come from this:
image

So we believe that the last month option is not properly selecting the whole month. Maybe it is because it is based on checking if Monday belongs to that month?

Unfortunately I cannot reproduce this in the test environment as there is no data available for January.

Thanks for your time,
Jaime


(Prosper) #2

Dear Jaime,

Form the tables above you have weekly data and trying to aggregate to monthly and for 2019 week 5 overlaps January and February. Basically you cant have a perfect match and the system probably treats these overlaps differently. You cant have a perfect aggregation for weekly upwards.

00


(Tomas Sala) #3

Hi,

I think that the problem is not week 5, in both cases it is aggregating this week), the problem is week 1, in the first case it aggregates it but not in the “Last month” case.
As far as we know DHIS2 aggregates based on Thursdays (the week belongs to the month where the Thursday is), so in both cases week 1 should be aggregated to January, but it’s not in the “Last month” case.

Best regards and thank you.


(M.Selvaraaj Prabu) #4

I am confused.

DHIS2 aggregates based on Thursdays (the week belongs to the month where the Thursday is

Does this mean, in the case of Jan 2019, the data from Jan 1 to Jan 6 will goto Dec 2018?


(Jaime Bosque) #5

Thanks everyone for their replies. As far as I see it is confusing for the user as Week 1 is clearly not being taken into account when selecting last month (being now in February).

The problem is that if you select the last three months it does take Week 1 into account for January. But it doesn’t do it for current month. The way I see it is confusing…


(Tomas Sala) #6

The Thursday of this week is in January, so this week should be aggregated in January, for both cases.


(Scott Russpatrick) #7

@jomutsani can you help @Jaime_Bosque report this as a bug? Weeks 1 through 5 should have been included in both the weekly and last month but it seems that for last month (which was 5 weeks) only included the previous 4 weeks.


(James Omutsani) #8

This is done @Scott_Russpatrick under DHIS2-5990. I have tagged @Jaime_Bosque as the issue owner.

Jaime - Please visit and add more info to the issue for the fix to be well addressed. the team may have some questions for you too.

Best,
James.


(M.Selvaraaj Prabu) #9

Thanks for correcting me. Sorry for the typo.

I understand the W1, W2 and the W5 is a combination of Jan and Feb in this case. But the below statement sounds like the Thu will affect the monthly counts.

DHIS2 aggregates based on Thursdays (the week belongs to the month where the Thursday is

Please clarify.


(Tomas Sala) #10

When a week has days in two months, the criteria to assign it to one month or another is where the majority of days are, it is the same that where the Thursday is.