need the output as of below in the datastage parallel job

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
vikram78
Participant
Posts: 4
Joined: Thu Aug 11, 2016 12:53 pm

need the output as of below in the datastage parallel job

Post by vikram78 »

i/p
------
cola colb colc cold
a 1 xx 12.50
a 2 xx 13.59
a 2 xx 14.50
a 2 yy 15.20
b 1 xx 13.20
b 2 xx 12.00
b 3 xx 13.00
b 3 zz 14.00
o/p
------
cola colc 1 2 3
a xx 12.50 28.09 0.00
a yy 0.00 15.20 0.00
b xx 13.20 12.00 13.00
b zz 0.00 0.00 14.00
BVIKRAM
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

:!: Sorry but you can't just drop made up input and output examples on us and then expect a fully fleshed out answer when next you stop by.

Describe your requirements in words then let us know what you've tried and what specific questions you have. And real sample data is always a good idea. Then we'd be willing - and able - to help.

High level - it's a vertical pivot of rows to columns.
-craig

"You can never have too many knives" -- Logan Nine Fingers
puliram
Participant
Posts: 20
Joined: Mon Apr 28, 2008 6:10 pm

Re: need the output as of below in the datastage parallel jo

Post by puliram »

1)First do group by on cola,colb,colc and sum on cold

2)Now split your flow into three streams based on your colb(1,2,3 based) by using transformer or filter stage.

3) Now try to join them back based on keys cola and colc only
do not use colb in join
Do full outer join on that.
whichever output values you see nulls in columns 1,2,3 convert them to 0.00

Just do little tweaking here and there. You should be able to achieve it.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

:!: puliram, we're really trying to discourage people from creating drive-by posts like this. I know you're trying to help but next time could you please wait for a properly expanded reply from the OP? Thanks.
-craig

"You can never have too many knives" -- Logan Nine Fingers
SURA
Premium Member
Premium Member
Posts: 1229
Joined: Sat Jul 14, 2007 5:16 am
Location: Sydney

Post by SURA »

Yes thats right!

This morning when i read the post, it looks like an SMS to the mate \ team member , not the request to get the solution.

Its not a good practice and i was waiting for the comments .

I totally agree.
Thanks
Ram
----------------------------------
Revealing your ignorance is fine, because you get a chance to learn.
vikram78
Participant
Posts: 4
Joined: Thu Aug 11, 2016 12:53 pm

Post by vikram78 »

sorry craig, it is my first post and i am not aware of the proper format to post here and hereafter it wont repeat
BVIKRAM
vikram78
Participant
Posts: 4
Joined: Thu Aug 11, 2016 12:53 pm

Post by vikram78 »

actually my intention is to get the suggestion/solution for my questions and i am sorry for not following the proper format/practice and hereafter i will follow the good practices.

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

Post by chulett »

Appreciate that, it will make it much easier to help you out in the future and get you to a solution faster if you help set things up for us properly.

Now, make sure to come back and clarify your requirements and ask some actual questions if you need more help than what puliram has supplied so far! :)
-craig

"You can never have too many knives" -- Logan Nine Fingers
vikram78
Participant
Posts: 4
Joined: Thu Aug 11, 2016 12:53 pm

Re: need the output as of below in the datastage parallel jo

Post by vikram78 »

Thanks puliram!

Today i will try as per your suggestions and will let you know the results
BVIKRAM
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

That solution does not cover the possibility that colb might not be in {1,2,3}. This information was not provided in your original "specification".
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply