DSXchange: DataStage and IBM Websphere Data Integration Forum
View next topic
View previous topic
Add To Favorites
Author Message
synsog



Group memberships:
Premium Members

Joined: 01 Aug 2010
Posts: 232
Location: Pune
Points: 2274

Post Posted: Wed Dec 05, 2018 8:24 pm Reply with quote    Back to top    

DataStage® Release: 11x
Job Type: Parallel
OS: Windows
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

Premium Poster


since January 2006

Group memberships:
Premium Members, Inner Circle, Server to Parallel Transition Group

Joined: 12 Nov 2002
Posts: 43011
Location: Denver, CO
Points: 221947

Post Posted: Wed Dec 05, 2018 8:53 pm Reply with quote    Back to top    

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

Space Available
Rate this response:  
Not yet rated
qt_ky



Group memberships:
Premium Members

Joined: 03 Aug 2011
Posts: 2870
Location: USA
Points: 21792

Post Posted: Thu Dec 06, 2018 6:02 am Reply with quote    Back to top    

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
Rate this response:  
Not yet rated
synsog



Group memberships:
Premium Members

Joined: 01 Aug 2010
Posts: 232
Location: Pune
Points: 2274

Post Posted: Thu Dec 06, 2018 7:45 am Reply with quote    Back to top    

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
Rate this response:  
Not yet rated
chulett

Premium Poster


since January 2006

Group memberships:
Premium Members, Inner Circle, Server to Parallel Transition Group

Joined: 12 Nov 2002
Posts: 43011
Location: Denver, CO
Points: 221947

Post Posted: Thu Dec 06, 2018 8:51 am Reply with quote    Back to top    

Yes. It is a way.

_________________
-craig

Space Available
Rate this response:  
Not yet rated
ray.wurlod

Premium Poster
Participant

Group memberships:
Premium Members, Inner Circle, Australia Usergroup, Server to Parallel Transition Group

Joined: 23 Oct 2002
Posts: 54535
Location: Sydney, Australia
Points: 295717

Post Posted: Sun Dec 09, 2018 6:45 pm Reply with quote    Back to top    

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.
Rate this response:  
Not yet rated
chulett

Premium Poster


since January 2006

Group memberships:
Premium Members, Inner Circle, Server to Parallel Transition Group

Joined: 12 Nov 2002
Posts: 43011
Location: Denver, CO
Points: 221947

Post Posted: Mon Dec 10, 2018 6:44 am Reply with quote    Back to top    

That is a way as well. Wink

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

_________________
-craig

Space Available
Rate this response:  
Not yet rated
Display posts from previous:       

Add To Favorites
View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2002 phpBB Group
Theme & Graphics by Daz :: Portal by Smartor
All times are GMT - 6 Hours