sort records and put Null if there are more matches on key

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
vsi
Premium Member
Premium Member
Posts: 507
Joined: Wed Mar 15, 2006 1:44 pm

sort records and put Null if there are more matches on key

Post by vsi »

I have data like this

Location Timezone
1000 CST
1000 PST
1000 EST
1000
1100 IST
1100
1200
1300 GMT
1300 CST

My Output should look like

Location Timezone
1000
1100 IST
1200
1300

How Can I get this .....sort keychange is not helping

i.e if there are multiple timezones i need to keep null
else data
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

I cannot understand your rules for getting from your input to your output. Could you perhaps explain what your are trying to achieve?
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Re: sort records and put Null if there are more matches on k

Post by ArndW »

vsi wrote:I have data like this

Location Timezone
1000 CST
1000 PST
1000 EST
1000
1100 IST
1100
1200
1300 GMT
1300 CST

My Output should look like

Location Timezone
1000
1100 IST
1200
1300

How Can I get this .....sort keychange is not helping

i.e if there are multiple timezones i need to keep null
else data
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Your example doesn't match your "i.e." written description. :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
vsi
Premium Member
Premium Member
Posts: 507
Joined: Wed Mar 15, 2006 1:44 pm

Post by vsi »

iF THERE ARE multiple timezones on location
timezone should be null
if there is only one timezone ..Then I have to take the timezone as it is

if the location has a null timezone and a timezone . I have to take timezone
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Use an aggregator to get the distinct timeZone count and set those with > 1 as NULL.
RohitNara
Participant
Posts: 3
Joined: Wed Jan 07, 2009 2:22 am

Re: sort records and put Null if there are more matches on k

Post by RohitNara »

what if
Location Timezone
1000 CST
1000 PST
1000 NULL
this kind of data occurs???
RohitN
RohitNara
Participant
Posts: 3
Joined: Wed Jan 07, 2009 2:22 am

Re: sort records and put Null if there are more matches on k

Post by RohitNara »

what if
Location Timezone
1000 CST
1000 PST
1000 NULL
this kind of data occurs???
RohitN
Sreenivasulu
Premium Member
Premium Member
Posts: 892
Joined: Thu Oct 16, 2003 5:18 am

Post by Sreenivasulu »

'Null' is empty ie like a blackhole. You have mentioned 'null' as a word then you need to handle this record before this stage

Regards
Sreeni
Post Reply