FiscalYear Period type?

Hi there. I was wondering if it would be possible to implement the fiscal year period type? This meay have come up before, but it seems we may need it soon.

  • FY 2010 runs from October 1st 2009 through September 30th 2010.
  • FY 2011 is from October 1st 2010 through September 30th 2011.
  • FY 2012 is from October 1st 2011 through September 30th 2012.

I think it would look something like this…perhaps…

private Period createPeriod( Calendar cal )

{
    cal.set( Calendar.YEAR, cal.get( Calendar.YEAR ) + cal.get( Calendar.MONTH ) % 10 );
    cal.set( Calendar.MONTH, Calendar.OCTOBER );
    cal.set( Calendar.DATE, 1 );

    Date startDate = cal.getTime();

    cal.add( Calendar.YEAR, 1 );
    cal.set( Calendar.DAY_OF_YEAR, cal.get( Calendar.DAY_OF_YEAR ) - 1  );

    return new Period( this, startDate, cal.getTime() );
}

What I am not sure about is all the rest of the methods which need to be in the API, as well as the aggregation engine. Data will be entered in our case quarterly, but needs to be aggregated to fiscal years.

Regards.
Jason

···


Jason P. Pickering
email: jason.p.pickering@gmail.com
tel:+260974901293

I think this is needed in many countries

Knut (from my phone)

···

On Feb 23, 2011 7:12 AM, “Jason Pickering” jason.p.pickering@gmail.com wrote:

Hi there. I was wondering if it would be possible to implement the fiscal year period type? This meay have come up before, but it seems we may need it soon.

  • FY 2010 runs from October 1st 2009 through September 30th 2010.
  • FY 2011 is from October 1st 2010 through September 30th 2011.
  • FY 2012 is from October 1st 2011 through September 30th 2012.

I think it would look something like this…perhaps…

private Period createPeriod( Calendar cal )


{
    cal.set( Calendar.YEAR, cal.get( Calendar.YEAR ) + cal.get( Calendar.MONTH ) % 10 );
    cal.set( Calendar.MONTH, Calendar.OCTOBER );
    cal.set( Calendar.DATE, 1 );

    Date startDate = cal.getTime();



    cal.add( Calendar.YEAR, 1 );
    cal.set( Calendar.DAY_OF_YEAR, cal.get( Calendar.DAY_OF_YEAR ) - 1  );

    return new Period( this, startDate, cal.getTime() );
}

What I am not sure about is all the rest of the methods which need to be in the API, as well as the aggregation engine. Data will be entered in our case quarterly, but needs to be aggregated to fiscal years.

Regards.
Jason


Jason P. Pickering
email: jason.p.pickering@gmail.com
tel:+260974901293


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Thanks

Kenya financial year

  • FY 2010/11 - runs from July 1st 2010 through June 30th 2011.
  • Y 2011/12 -runs from July 1st 2011 through June 30th 2012.
  • Y 2012/13 - runs from July 1st 2012 through June 30th 2013.
    Regards
···

On Wed, Feb 23, 2011 at 9:11 AM, Jason Pickering jason.p.pickering@gmail.com wrote:

Hi there. I was wondering if it would be possible to implement the fiscal year period type? This meay have come up before, but it seems we may need it soon.

  • FY 2010 runs from October 1st 2009 through September 30th 2010.
  • FY 2011 is from October 1st 2010 through September 30th 2011.
  • FY 2012 is from October 1st 2011 through September 30th 2012.

I think it would look something like this…perhaps…

private Period createPeriod( Calendar cal )


{
    cal.set( Calendar.YEAR, cal.get( Calendar.YEAR ) + cal.get( Calendar.MONTH ) % 10 );
    cal.set( Calendar.MONTH, Calendar.OCTOBER );
    cal.set( Calendar.DATE, 1 );

    Date startDate = cal.getTime();



    cal.add( Calendar.YEAR, 1 );
    cal.set( Calendar.DAY_OF_YEAR, cal.get( Calendar.DAY_OF_YEAR ) - 1  );

    return new Period( this, startDate, cal.getTime() );
}

What I am not sure about is all the rest of the methods which need to be in the API, as well as the aggregation engine. Data will be entered in our case quarterly, but needs to be aggregated to fiscal years.

Regards.
Jason


Jason P. Pickering
email: jason.p.pickering@gmail.com
tel:+260974901293


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp


Samuel Cheburet
Ministry Of Health
P.O. Box 20781
Nairobi, Kenya
Mobile- 0721624338

Hi Samuel,

Yeah, I have seen that there are a wide variety of what people
consider to be Fiscal Years. The one that I mentioned was the US
Fiscal year, often used for reporting to USAID and PEPFAR. It seems
there might be others which may be needed.

I found a discussion from Bob a while back about a more generic period
type to deal with these situations, but not sure if there has been any
thought or work put into it.

Maybe we go for FiscalYear beginning in October and July?

Regards,
Jason

···

On Wed, Feb 23, 2011 at 4:05 PM, samuel cheburet <samuelcheburet@gmail.com> wrote:

Thanks
Kenya financial year

FY 2010/11 - runs from July 1st 2010 through June 30th 2011.
Y 2011/12 -runs from July 1st 2011 through June 30th 2012.
Y 2012/13 - runs from July 1st 2012 through June 30th 2013.

Regards

On Wed, Feb 23, 2011 at 9:11 M, Jason Pickering > <jason.p.pickering@gmail.com> wrote:

Hi there. I was wondering if it would be possible to implement the fiscal
year period type? This meay have come up before, but it seems we may need it
soon.

FY 2010 runs from October 1st 2009 through September 30th 2010.
FY 2011 is from October 1st 2010 through September 30th 2011.
FY 2012 is from October 1st 2011 through September 30th 2012.

I think it would look something like this..perhaps..

private Period createPeriod\( Calendar cal \)
\{
    cal\.set\( Calendar\.YEAR, cal\.get\( Calendar\.YEAR \) \+ cal\.get\(

Calendar.MONTH ) % 10 );
cal.set( Calendar.MONTH, Calendar.OCTOBER );
cal.set( Calendar.DATE, 1 );

    Date startDate = cal\.getTime\(\);

    cal\.add\( Calendar\.YEAR, 1 \);
    cal\.set\( Calendar\.DAY\_OF\_YEAR, cal\.get\( Calendar\.DAY\_OF\_YEAR \) \-

1 );

    return new Period\( this, startDate, cal\.getTime\(\) \);
\}

What I am not sure about is all the rest of the methods which need to be
in the API, as well as the aggregation engine. Data will be entered in our
case quarterly, but needs to be aggregated to fiscal years.

Regards.
Jason

--
Jason P. Pickering
email: jason.p.pickering@gmail.com
tel:+260974901293

_______________________________________________
Mailing list: DHIS 2 developers in Launchpad
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : DHIS 2 developers in Launchpad
More help : ListHelp - Launchpad Help

--
Samuel Cheburet
Ministry Of Health
P.O. Box 20781
Nairobi, Kenya
Mobile- 0721624338

--
Jason P. Pickering
email: jason.p.pickering@gmail.com
tel:+260974901293

Hi, currently our approach to period types is to have one Java class per type containing the required logic for generating periods etc. Adding new ones is easy. The downsize is that we risk proliferation of these classes and ending up with 12 of them which becomes a bit messy, we already have an April-based and now July and October-based are suggested. The alternative is to create (complex) implementation of dynamic period types. Anyway I think we can add the ones suggested for now. Should we add a blueprint of do we already have one?

Lars

Agreed, it is messy but these seem to be the pressing ones.

I have a blueprint and a patch for both.

I have sent the patch for October, but given Samuels concerns, I made
one for July based fiscal years as well.

I will send it to you, in yet another email.

···

2011/2/23 Lars Helge Øverland <larshelge@gmail.com>:

Hi, currently our approach to period types is to have one Java class per
type containing the required logic for generating periods etc. Adding new
ones is easy. The downsize is that we risk proliferation of these classes
and ending u,p with 12 of them which becomes a bit messy, we already have an
April-based and now July and October-based are suggested. The alternative is
to create (complex) implementation of dynamic period types. Anyway I think
we can add the ones suggested for now. Should we add a blueprint of do we
already have one?
Lars

--
Jason P. Pickering
email: jason.p.pickering@gmail.com
tel:+260974901293

Hi Jason

This is quite a tricky requirement and there different approaches
which might work. My gut instinct is to have a single "internal"
timebase to the system and to deal with different calendaring
requirements on the aggregation, presentation and output side. So for
example a datavalue persisted with period 2010-Q1 would always refer
to Jan-Mar for that year, But in a report requiring USGOV-FY (please
don't just say fiscal year - all countries have a fiscal year and they
don't all run from Sep-Oct! Ah, I see Samuel has already come in on
this.) that same period would be presented (and aggregated) as
2010-Q2. There would be some complexities to solve here, but would
have the benefit that, at least internally, a time period is always a
comparable time period.

If we are going to mess around creating (yet more) custom period types
then one way might be to add an attribute to the period class
indicating the preferred calendar type to be used in aggregation and
reporting. So any period eg 2007 or 200-7-Q1 or 2007-01 would be
qualified by a calendar type (in most cases ISO8601 but also possibly
USGOV-FY). This is the approach finally agreed to in SDMX-HD, for
example though I haven't seen how the IMR has implemented this. We
could also be less grand and just call the attribute an offset rather
than a calendar type, but there may be some requirements which go
beyond a simple 3 month offset. US week numbers for example :slight_smile:

Cheers
Bob

···

On 23 February 2011 06:11, Jason Pickering <jason.p.pickering@gmail.com> wrote:

Hi there. I was wondering if it would be possible to implement the fiscal
year period type? This meay have come up before, but it seems we may need it
soon.

FY 2010 runs from October 1st 2009 through September 30th 2010.
FY 2011 is from October 1st 2010 through September 30th 2011.
FY 2012 is from October 1st 2011 through September 30th 2012.

I think it would look something like this..perhaps..

private Period createPeriod\( Calendar cal \)
\{
    cal\.set\( Calendar\.YEAR, cal\.get\( Calendar\.YEAR \) \+ cal\.get\(

Calendar.MONTH ) % 10 );
cal.set( Calendar.MONTH, Calendar.OCTOBER );
cal.set( Calendar.DATE, 1 );

    Date startDate = cal\.getTime\(\);

    cal\.add\( Calendar\.YEAR, 1 \);
    cal\.set\( Calendar\.DAY\_OF\_YEAR, cal\.get\( Calendar\.DAY\_OF\_YEAR \) \- 1

);

    return new Period\( this, startDate, cal\.getTime\(\) \);
\}

What I am not sure about is all the rest of the methods which need to be in
the API, as well as the aggregation engine. Data will be entered in our case
quarterly, but needs to be aggregated to fiscal years.

Regards.
Jason

--
Jason P. Pickering
email: jason.p.pickering@gmail.com
tel:+260974901293

_______________________________________________
Mailing list: DHIS 2 developers in Launchpad
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : DHIS 2 developers in Launchpad
More help : ListHelp - Launchpad Help

We already separate persistence and aggregation in that aggregation engine is agnostic re which period type a period/datavalue has, it just looks at the start/end-date. I think the issue with Samuel’s request is that people want to persist data for a fiscal year period.

···

On Wed, Feb 23, 2011 at 5:06 PM, Bob Jolliffe bobjolliffe@gmail.com wrote:

Hi Jason

This is quite a tricky requirement and there different approaches

which might work. My gut instinct is to have a single “internal”

timebase to the system and to deal with different calendaring

requirements on the aggregation, presentation and output side. So for

example a datavalue persisted with period 2010-Q1 would always refer

to Jan-Mar for that year, But in a report requiring USGOV-FY (please

don’t just say fiscal year - all countries have a fiscal year and they

don’t all run from Sep-Oct! Ah, I see Samuel has already come in on

this.) that same period would be presented (and aggregated) as

2010-Q2. There would be some complexities to solve here, but would

have the benefit that, at least internally, a time period is always a

comparable time period.

If we are going to mess around creating (yet more) custom period types

then one way might be to add an attribute to the period class

indicating the preferred calendar type to be used in aggregation and

reporting. So any period eg 2007 or 200-7-Q1 or 2007-01 would be

qualified by a calendar type (in most cases ISO8601 but also possibly

USGOV-FY). This is the approach finally agreed to in SDMX-HD, for

example though I haven’t seen how the IMR has implemented this. We

could also be less grand and just call the attribute an offset rather

than a calendar type, but there may be some requirements which go

beyond a simple 3 month offset. US week numbers for example :slight_smile:

Cheers

Bob

On 23 February 2011 06:11, Jason Pickering jason.p.pickering@gmail.com wrote:

Hi there. I was wondering if it would be possible to implement the fiscal

year period type? This meay have come up before, but it seems we may need it

soon.

FY 2010 runs from October 1st 2009 through September 30th 2010.

FY 2011 is from October 1st 2010 through September 30th 2011.

FY 2012 is from October 1st 2011 through September 30th 2012.

I think it would look something like this…perhaps…

private Period createPeriod( Calendar cal )
{
    cal.set( Calendar.YEAR, cal.get( Calendar.YEAR ) + cal.get(

Calendar.MONTH ) % 10 );

    cal.set( Calendar.MONTH, Calendar.OCTOBER );
    cal.set( Calendar.DATE, 1 );
    Date startDate = cal.getTime();
    cal.add( Calendar.YEAR, 1 );
    cal.set( Calendar.DAY_OF_YEAR, cal.get( Calendar.DAY_OF_YEAR ) - 1

);

    return new Period( this, startDate, cal.getTime() );
}

What I am not sure about is all the rest of the methods which need to be in

the API, as well as the aggregation engine. Data will be entered in our case

quarterly, but needs to be aggregated to fiscal years.

Regards.

Jason

Jason P. Pickering

email: jason.p.pickering@gmail.com

tel:+260974901293


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Here is the patch I created to deal with US Fiscal years (Oct-Sept)
and Kenyan fiscal years (July-June). Obviously, it does not implement
anything which Bob talks about, but is really just an adjustment of
the FinancialAprilPeriodType.

Regards,
Jason

FiscalYearPeriodTypes.patch (16.4 KB)

···

2011/2/23 Lars Helge Øverland <larshelge@gmail.com>:

We already separate persistence and aggregation in that aggregation engine
is agnostic re which period type a period/datavalue has, it just looks at
the start/end-date. I think the issue with Samuel's request is that people
want to persist data for a fiscal year period.

On Wed, Feb 23, 2011 at 5:06 PM, Bob Jolliffe <bobjolliffe@gmail.com> wrote:

Hi Jason

This is quite a tricky requirement and there different approaches
which might work. My gut instinct is to have a single "internal"
timebase to the system and to deal with different calendaring
requirements on the aggregation, presentation and output side. So for
example a datavalue persisted with period 2010-Q1 would always refer
to Jan-Mar for that year, But in a report requiring USGOV-FY (please
don't just say fiscal year - all countries have a fiscal year and they
don't all run from Sep-Oct! Ah, I see Samuel has already come in on
this.) that same period would be presented (and aggregated) as
2010-Q2. There would be some complexities to solve here, but would
have the benefit that, at least internally, a time period is always a
comparable time period.

If we are going to mess around creating (yet more) custom period types
then one way might be to add an attribute to the period class
indicating the preferred calendar type to be used in aggregation and
reporting. So any period eg 2007 or 200-7-Q1 or 2007-01 would be
qualified by a calendar type (in most cases ISO8601 but also possibly
USGOV-FY). This is the approach finally agreed to in SDMX-HD, for
example though I haven't seen how the IMR has implemented this. We
could also be less grand and just call the attribute an offset rather
than a calendar type, but there may be some requirements which go
beyond a simple 3 month offset. US week numbers for example :slight_smile:

Cheers
Bob

On 23 February 2011 06:11, Jason Pickering <jason.p.pickering@gmail.com> >> wrote:
> Hi there. I was wondering if it would be possible to implement the
> fiscal
> year period type? This meay have come up before, but it seems we may
> need it
> soon.
>
> FY 2010 runs from October 1st 2009 through September 30th 2010.
> FY 2011 is from October 1st 2010 through September 30th 2011.
> FY 2012 is from October 1st 2011 through September 30th 2012.
>
> I think it would look something like this..perhaps..
>
> private Period createPeriod( Calendar cal )
> {
> cal.set( Calendar.YEAR, cal.get( Calendar.YEAR ) + cal.get(
> Calendar.MONTH ) % 10 );
> cal.set( Calendar.MONTH, Calendar.OCTOBER );
> cal.set( Calendar.DATE, 1 );
>
> Date startDate = cal.getTime();
>
> cal.add( Calendar.YEAR, 1 );
> cal.set( Calendar.DAY_OF_YEAR, cal.get( Calendar.DAY_OF_YEAR ) -
> 1
> );
>
> return new Period( this, startDate, cal.getTime() );
> }
>
> What I am not sure about is all the rest of the methods which need to be
> in
> the API, as well as the aggregation engine. Data will be entered in our
> case
> quarterly, but needs to be aggregated to fiscal years.
>
> Regards.
> Jason
>
>
> --
> Jason P. Pickering
> email: jason.p.pickering@gmail.com
> tel:+260974901293
>
> _______________________________________________
> Mailing list: DHIS 2 developers in Launchpad
> Post to : dhis2-devs@lists.launchpad.net
> Unsubscribe : DHIS 2 developers in Launchpad
> More help : ListHelp - Launchpad Help
>
>

_______________________________________________
Mailing list: DHIS 2 developers in Launchpad
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : DHIS 2 developers in Launchpad
More help : ListHelp - Launchpad Help

--
Jason P. Pickering
email: jason.p.pickering@gmail.com
tel:+260974901293

Hi I have added both.

 What is the current status of fiscal year support?   It looks like Jason's patches have been applied in the current (2.4) release, but when we try to select these from a dropdown in the data entry interfaces, we get Javascript errors with empty/non-reponsive UI.   These are easy enough for us to fix up, but was the aggregation / reporting side of this ever addressed?  I can't find any blueprints or tasks on launchpad related to it (however, I'm not very used to LP yet, so....)

-David

David J. Trombley
Senior Software Architect
Social & Scientific Systems
dtrombley@s-3.com

···

2011/2/24 Lars Helge Øverland larshelge@gmail.com

Hi I have added both.


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Hi Dave,

There are currently three fiscal period types (April, July and October).

If you have patch or bug, please submit a bug report on launchpad and
attach the patch with the bug report.

The current release is 2.5, released today available from
Downloads - DHIS2 and may be work looking at.

AFAIK, the aggregation works fine, but not sure about the data entry.

Best regards,
Jason

···

2011/10/14 Dave Trombley <dave.trombley@gmail.com>:

 What is the current status of fiscal year support?   It looks like

Jason's patches have been applied in the current (2.4) release, but when we
try to select these from a dropdown in the data entry interfaces, we get
Javascript errors with empty/non-reponsive UI. These are easy enough for
us to fix up, but was the aggregation / reporting side of this ever
addressed? I can't find any blueprints or tasks on launchpad related to it
(however, I'm not very used to LP yet, so....)

-David

David J. Trombley
Senior Software Architect
Social & Scientific Systems
<dtrombley@s-3.com>

2011/2/24 Lars Helge Øverland <larshelge@gmail.com>

Hi I have added both.
_______________________________________________
Mailing list: DHIS 2 developers in Launchpad
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : DHIS 2 developers in Launchpad
More help : ListHelp - Launchpad Help

Hi Dave,

Its a bug for sure. I was able to reproduce it in data entry.

You can track it here (or submit a patch) :slight_smile:

https://bugs.launchpad.net/dhis2/+bug/874772

···

On Fri, Oct 14, 2011 at 10:18 PM, Jason Pickering <jason.p.pickering@gmail.com> wrote:

Hi Dave,

There are currently three fiscal period types (April, July and October).

If you have patch or bug, please submit a bug report on launchpad and
attach the patch with the bug report.

The current release is 2.5, released today available from
Downloads - DHIS2 and may be work looking at.

AFAIK, the aggregation works fine, but not sure about the data entry.

Best regards,
Jason

2011/10/14 Dave Trombley <dave.trombley@gmail.com>:

 What is the current status of fiscal year support?   It looks like

Jason's patches have been applied in the current (2.4) release, but when we
try to select these from a dropdown in the data entry interfaces, we get
Javascript errors with empty/non-reponsive UI. These are easy enough for
us to fix up, but was the aggregation / reporting side of this ever
addressed? I can't find any blueprints or tasks on launchpad related to it
(however, I'm not very used to LP yet, so....)

-David

David J. Trombley
Senior Software Architect
Social & Scientific Systems
<dtrombley@s-3.com>

2011/2/24 Lars Helge Øverland <larshelge@gmail.com>

Hi I have added both.
_______________________________________________
Mailing list: DHIS 2 developers in Launchpad
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : DHIS 2 developers in Launchpad
More help : ListHelp - Launchpad Help

For the record, the fiscal periods in data entry have been implemented
in trunk by jason and will be part of 2.6 release.

Lars

···

On Fri, Oct 14, 2011 at 10:18 PM, Jason Pickering <jason.p.pickering@gmail.com> wrote:

Hi Dave,

There are currently three fiscal period types (April, July and October).

If you have patch or bug, please submit a bug report on launchpad and
attach the patch with the bug report.

The current release is 2.5, released today available from
Downloads - DHIS2 and may be work looking at.

AFAIK, the aggregation works fine, but not sure about the data entry.

Best regards,
Jason