Need help in the logic

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
synsog
Premium Member
Premium Member
Posts: 232
Joined: Sun Aug 01, 2010 11:01 pm
Location: Pune

Need help in the logic

Post by synsog »

Need help in below topic

input data

Col1(Timestamp) Col2(timestamp)

2017-12-31 10:05:06 | 2017-12-31 10:05:06
2018-01-01 07:20:05 | 2018-01-01 07:23:05
2018-01-01 07:22:05 | 2018-01-01 07:25:05
2019-01-01 06:00:04 | 2019-01-01 06:00:05

output needed

2017-12-31 10:05:06 | 2017-12-31 10:05:06
2018-01-01 07:20:05 | 2018-01-01 07:25:05
2019-01-01 06:00:04 | 2019-01-01 06:00:05

we have to compare col1 and col2, if col1 timestamp falls between col2 for exp shown above 2 and 3 rd record need 2nd record as op

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

Post by chulett »

So... you need to collapse multiple records over a single day down to a single record and min/max the timestamp? If so - what are your thoughts, what have you tried? If not - please clarify.
-craig

"You can never have too many knives" -- Logan Nine Fingers
qt_ky
Premium Member
Premium Member
Posts: 2895
Joined: Wed Aug 03, 2011 6:16 am
Location: USA

Post by qt_ky »

I don't get it. Are you comparing values across multiple records???
Choose a job you love, and you will never have to work a day in your life. - Confucius
synsog
Premium Member
Premium Member
Posts: 232
Joined: Sun Aug 01, 2010 11:01 pm
Location: Pune

Post by synsog »

i using datastage transformer for saving off the values with stage variables and looping based on above..is it way of doing it?
Last edited by synsog on Tue Dec 11, 2018 7:42 am, edited 1 time in total.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Yes. It is a way.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

I'd use an Aggregator stage if all that is required is the grouping columns and the minimum and maximum value per group.
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 »

That is a way as well. :wink:

Just make sure you group on the date and not the full timestamp.
-craig

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