Logic for implementation of the req

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
InfoSeek
Premium Member
Premium Member
Posts: 15
Joined: Thu Oct 21, 2010 12:55 pm

Logic for implementation of the req

Post by InfoSeek »

Gurus, here is something that I need your help on

I have two cols - F.No and W.No (Both of Datatype Integer), and two date cols , s.date and e.date


||F.No||W.NO||e.date||s.date||

F.no - is supposed to have only one W.no associated with it, and only either of s.date or e.date associated with it.

Currently its so happening that some W.no's have both e.date and s,.date , and if that is happening we need to push the s.date ahead (something like a s.date + 5, not quite that simple , but for the purposes of this conv something like that).....

This so, that every w.no has only date associated with it.

I'm really stumped for the logic and don't where to begin.

Any pointers in the right direction are greatly appreciated

Thank you for your time

Regards
IS
us1aslam1us
Charter Member
Charter Member
Posts: 822
Joined: Sat Sep 17, 2005 5:25 pm
Location: USA

Post by us1aslam1us »

It is quite hard to understand your requirement. Share some information on how your input data looks and what exactly are you expecting in your output.

Sample Data??

sAM
I haven't failed, I've found 10,000 ways that don't work.
Thomas Alva Edison(1847-1931)
InfoSeek
Premium Member
Premium Member
Posts: 15
Joined: Thu Oct 21, 2010 12:55 pm

Some more data

Post by InfoSeek »

Sorry, here is more info.

The First column is activity number , the second col is week number , the date cols are end.date and start.date....

This is how ideally the data should look like
F.no||w.No||e.date||s.date||
1 || 234||Oct 4th||0||


The current data looks like
F.no||w.No||e.date||s.date||
1 || 234||Oct 4th||Oct 6th||

One activity cannot have either a e.date or s.date for the same week (w.No), not both as is the case in the above example.

If that's the case the activity s.date needs to be pushed to the next week (235).

So the data should look like
F.no||w.No||e.date||s.date||
1 || 234||Oct 4th||0||
1||235||0||Oct 6th||


At this point even the date representation doesnt matter, what is really necessary if a week has both e.date and s.date , the s.date gets pushed to the next week (from 234 to 235).

Thank you for taking the time to look at it and respond.

Regards
IS
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Derive EDate as something like:

Code: Select all

If IsNotNull(InLink.SDate) And IsNotNull(InLink.EDate) Then DateFromDaysSince(7,InLink.EDate) Else InLink.EDate
Apply appropriate conversion functions where needed.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
InfoSeek
Premium Member
Premium Member
Posts: 15
Joined: Thu Oct 21, 2010 12:55 pm

Post by InfoSeek »

Thank you Ray for the input, will try this.

We've modified the query at source currently but will try this as well.
Post Reply