Page 1 of 1

need the output as of below in the datastage parallel job

Posted: Thu Aug 11, 2016 1:06 pm
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

Posted: Thu Aug 11, 2016 2:11 pm
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.

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

Posted: Thu Aug 11, 2016 2:24 pm
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.

Posted: Thu Aug 11, 2016 2:36 pm
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.

Posted: Thu Aug 11, 2016 8:14 pm
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.

Posted: Thu Aug 11, 2016 9:04 pm
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

Posted: Thu Aug 11, 2016 9:09 pm
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

Posted: Thu Aug 11, 2016 9:11 pm
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! :)

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

Posted: Thu Aug 11, 2016 9:11 pm
by vikram78
Thanks puliram!

Today i will try as per your suggestions and will let you know the results

Posted: Thu Aug 11, 2016 10:07 pm
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".