number of working days in a week

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
vikramkola
Premium Member
Premium Member
Posts: 15
Joined: Sun Feb 22, 2009 3:31 pm

number of working days in a week

Post by vikramkola »

please help me in finding number of working days in a week syntax.

thanks in advance.
vikram
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Short answer is 5. :wink:

I'm assuming you mean the number of working days between two dates. Regardless, you would need to define a 'working day' for us. Does it include company holidays? If so, you'll need some kind of 'date dimension' like lookup, be it a warehouse table or spreasheet dumped to a csv.
Last edited by chulett on Wed Feb 24, 2010 12:51 pm, edited 1 time in total.
-craig

"You can never have too many knives" -- Logan Nine Fingers
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

If it doesn't, i.e. you just need to skip Sat & Sun, then you could write something to loop from one date to the next and not count them. A lookup would be best, however, as you may be able to get the number of 'working days' a week or a month at a time.
-craig

"You can never have too many knives" -- Logan Nine Fingers
vikramkola
Premium Member
Premium Member
Posts: 15
Joined: Sun Feb 22, 2009 3:31 pm

Post by vikramkola »

chulett wrote:Define a 'working day' for us. Does it include company holidays? If so, you'll need some kind of 'date dimension' like lookup, be it a warehouse table or spreasheet dumped to a csv. ...


for example:02/15/2010 to 02/21/2010 are week days
02/17/2010 is holiday
02/20/2010 and 02/21/2010 are saturday and sunday

write a syntax in finding number of working days in this week.
data we are getting from a sequential file ,csv file.

I should get answer as 4.

give the trasformation functions syntax or what ever way as you can do please explain.
imagine how ever you like and please type the syntax, immediatly needed.
vikram
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Well, it's now four hours later, so I guess you don't need it now, since it was "immediately needed".

DSXchange is an all-volunteer site whose members post as and when (and if) they can, but at all times are under no obligation to do so. If you need immediate assistance sign up with your official support provider for super-priority service ("priority" typically only gets you four hour response time). Learn just how valuable "urgent" is.

You have been given a complete answer by previous posters.

If you choose not to implement it yourself, then that falls into the category of consulting (with concomitant payment).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Sorry, I had an immediate need to go for a job interview, so that took precedence. :?

And people can't decide on a solution for you, it needs to be something your company can support. For example, how will you know that "02/17/2010" is a holiday? Someone can lay out a solution that leverages a date dimension but that's no good if you don't have (or are not willing to build / support) one.

And as one last "ps" - you can tell what day is what by converting it to its "day of the week" number, which typically run from 1 to 7 or sometimes 0 to 6. And what day actually starts any given week (Sunday or Monday) is typically a configuration parameter.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply