FDRE-MoH / dhis-230

BSD 3-Clause "New" or "Revised" License
0 stars 7 forks source link

Yearly support question #7

Open mestachs opened 4 years ago

mestachs commented 4 years ago

Hello, Thanks for the work.

I tried your implementation for amharic calendar, looks to support 2 months offset for quarter/months.

But I noticed that in db, the year referenced in the _periodstructure is still the one for "month"

| iso    | startdate   | enddate    | yearly   | quarterly   |
|--------+-------------+------------+----------+-------------|
| 2012Q1 | 2019-07-08  | 2019-10-11 | 2011     | 2012Q1      |
| 2012Q2 | 2019-10-12  | 2020-01-09 | 2012     | 2012Q2      |
| 2018Q4 | 2026-04-09  | 2026-07-07 | 2018     | 2018Q4      | 

same for months

+----------+-------------+------------+----------+-------------+
| iso      | startdate   | enddate    | yearly   | quarterly   |
|----------+-------------+------------+----------+-------------|
| 201001   | 2017-09-11  | 2017-10-10 | 2010     | 2010Q1      |
| 201002   | 2017-10-11  | 2017-11-09 | 2010     | 2010Q2      |
| 201003   | 2017-11-10  | 2017-12-09 | 2010     | 2010Q2      |
| 201007   | 2018-03-10  | 2018-04-08 | 2010     | 2010Q3      |
| 201008   | 2018-04-09  | 2018-05-08 | 2010     | 2010Q4      |
| 201009   | 2018-05-09  | 2018-06-07 | 2010     | 2010Q4      |
| 201010   | 2018-06-08  | 2018-07-07 | 2010     | 2010Q4      |
| 201011   | 2018-07-08  | 2018-08-06 | 2010     | 2011Q1      |
| 201012   | 2018-08-07  | 2018-09-05 | 2010     | 2011Q1      |
| 201101   | 2018-09-11  | 2018-10-10 | 2011     | 2011Q1      |
| 201102   | 2018-10-11  | 2018-11-09 | 2011     | 2011Q2      |
| 201103   | 2018-11-10  | 2018-12-09 | 2011     | 2011Q2      |
| 201106   | 2019-02-08  | 2019-03-09 | 2011     | 2011Q3      |
| 201111   | 2019-07-08  | 2019-08-06 | 2011     | 2012Q1      |
| 201112   | 2019-08-07  | 2019-09-05 | 2011     | 2012Q1      |

I would have expected 201111 and 201112 as it's in 2012Q1 to end up in "2012" analytics summation/averages.

is this the desired "feature" or a "limitation/omission" ?

Thanks for the clarification

mestachs commented 4 years ago

@abyot can you help me answering this question ?

Melaeke commented 4 years ago

Hello,

Sorry for the late response. The question you posted is a desired feature. The aggregation considers a financial period scheme where the start of the current year is the 11'th month of the previous year. For example, the start date for "2012Q1" is "2019-07-08" which converted to Ethiopian calendar becomes, 2011-11-01. The same goes for Financial yearly periods as well. The starting of the year 2012 is 2011-10-01.

Hence why you are getting a period like this.

| iso | startdate | enddate | yearly | quarterly | |--------+-------------+------------+----------+-------------| | 2012Q1 | 2019-07-08 | 2019-10-11 | 2011 | 2012Q1 | | 2012Q2 | 2019-10-12 | 2020-01-09 | 2012 | 2012Q2 | | 2018Q4 | 2026-04-09 | 2026-07-07 | 2018 | 2018Q4 |

Hope this helps.