Calculate week & working days in month

Calculate week & working days in month

hyppool
hyppool

August 7th, 2012, 6:50 am #1

Hi,

I've been given the taks to calculate

* Number of week days in a month
* Number of working days in a month

Can some give me some pointers/ pseudo code as how this can be achieved.

Thanks in Advance
Quote
Share

Sean V
Sean V

August 7th, 2012, 12:26 pm #2

I maintain a static file which I load into cubes requiring this. Elegant solution? no. But it works...
Quote
Share

Joined: November 26th, 2001, 10:15 pm

August 7th, 2012, 12:36 pm #3

Why kill yourself over this -- the information exists in your organization already. Create whatever members you need to store this information and just load it. Slightly inefficient, but you can now go off and do cool things.

Regards,

Cameron Lackpour
Quote
Like
Share

hyppool
hyppool

August 7th, 2012, 1:18 pm #4

I maintain a static file which I load into cubes requiring this. Elegant solution? no. But it works...
Thanks for the replies..

I would agree with you as well... I have spent some time researching on this and there is no direct way of doing it..

One thing i found out though was that perhaps a CDF could work

'@JgetMonthNumberWorkDays(2009, 1, "aus")'

Sample CDF's for Date functions are provided over here -

http://www.oracle.com/technetwork/index ... 22117.html

But having said that I have never used CDF before and I'm not sure whether the value returned will have to be adjusted for public holidays..
Quote
Share

DanP
DanP

August 7th, 2012, 7:13 pm #5

Hmm July 4 is not a holiday in France but Batille day is

In Boston they celebrate Patriots day (when the Boston Marathon is run) but it is not a holiday elsewhere.

In most of the US the celebrate ML King Day but one state doesn't (or didin't for a while) Arizona?

Pre load the holidays and work days appropriate to your client.

Better yet retrieve them from the companies HR system - that way they will be maintained and updated.
Quote
Share

Stuart Game
Stuart Game

August 8th, 2012, 10:24 am #6

Why kill yourself over this -- the information exists in your organization already. Create whatever members you need to store this information and just load it. Slightly inefficient, but you can now go off and do cool things.

Regards,

Cameron Lackpour
Hi

I also agree with the static file approach, much simpler!

There is even a function in MS Excel now NETWORKDAYS that will calculate it for you (although you have to maintain a list of holidays that you want it to exclude).

Hope this helps
Stuart
Quote
Share

Joined: November 15th, 2007, 1:21 pm

August 8th, 2012, 1:17 pm #7

Thanks for the replies..

I would agree with you as well... I have spent some time researching on this and there is no direct way of doing it..

One thing i found out though was that perhaps a CDF could work

'@JgetMonthNumberWorkDays(2009, 1, "aus")'

Sample CDF's for Date functions are provided over here -

http://www.oracle.com/technetwork/index ... 22117.html

But having said that I have never used CDF before and I'm not sure whether the value returned will have to be adjusted for public holidays..
CDF is the hard way.

Like the others, I also load calendar data from a SQL calendar table. Very versatile, centrally maintained (working day changes in 2014..? all systems reflect change).
Quote
Like
Share


Confirmation of reply: