Jump to content

BIRT Developer Center Download


Photo
- - - - -

UK railway Period Script


  • Please log in to reply
1 reply to this topic

#1 magic_bern

magic_bern

    Junior Member

  • Members
  • PipPipPip
  • 93 posts

Posted 06 September 2016 - 06:24 AM

Sorry This may seem like a lazy post, but i have not done much scripting since forever and my attempts with the available BIRT functions are just not giving me anything useful.

 

I am running a report from Maximo, and i would like to return the network rail period based on the date from the report (i.e work order reported date). The aim is to group our report per railway period as opposed to month.

I am using BIRT Version: 3.7.1

 

I have attached my not so useful attempt and the the railway period start date calendar until 2035. 

there are only 13 periods each year (Start of Period 14 on the attachment is effectively the last day of period 13)

from looking at it i can say,

Period 1 always starts on the 01/04

Period 13 always ends on the 31/03

there are usually four weeks in a period except the last and first one that can be a bit longer or shorter depending on where the 01/04 or 31/03 falls

There are generally no more than 4 Sundays in a period

 

Thanks in advanced

 

 

Attached Files



#2 magic_bern

magic_bern

    Junior Member

  • Members
  • PipPipPip
  • 93 posts

Posted 08 September 2016 - 10:30 AM

After further examination of the calendar I think i came up with a solution.
 
from looking at the calendar in more details, it seems the simplest common thing about the railway period is that  is that they always have 4 Sundays, the first and the last period may be a bit longer or shorter but they they always have 4 Sundays.

 

As a result i created a small data element that counted the numbers of Sundays since the first of April of the year, then I had another data item providing the UK railways period depending on how many Sundays had happened since the first.

I have attached the report (3.7.1) for any comments on how it may be optimised or whether it could be of use to someone else.

No data source just one parameter that would passed from work order date or something when i add this.

 

Regards

Berny.

Attached Files