i have a scenario in which i/p columns areID,salary with
1,1000 2,2000 and 3,3000 i need an extra column in the o/p
named avg(salary)how can i get it?

Answer Posted / subhash

source -> Transforemer(add column DUMMY and give value 1)
==> 2links,
1st link(with 1 hard coded value) to Copy,
1,1000,1
2,2000,1
3,3000,1
2nd Link to Join,
1,1000
2,2000
3,3000

1st linkcopy -> aggregate (Group Key-->DUMMY, take avg)--
>Join
1,2000(AVG salary)
->Join --> target
1,1000,2000
2,2000,2000
3,3000,2000

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain ibm infosphere information server and highlight its main features?

609


i WANTED TO USE THE RANGE LOOKUP SCENARIO IN DATASTAGE 7.5.2 SRVER JOB.i HAVE A DATE FIELD IN SOURCE AND I SHOULD MATCH IT WITH A FIELD IN LOOKUP FILE.BUT,THE FIELDS SHOULD MATCH EVEN THOUGH THERE IS SOME RANGE.CAN SOMEONE TELL ME HOW CAN I DO THAT. THANKS

3313


Differentiate between odbc and drs stage?

593


How can we improve the performance in datastage?

654


file having these input and we have to get 3 output using same job Input 1 1 1 2 3 4 4 4 o/p1 o/p2 o/p3 1 1 2 2 1 3 3 1 4 4 4

538






What are the types of hashed files in data stage

646


what is the difference between == and eq in UNIX shell scripting?

972


What is the difference between odbc and drs stage?

639


how can we create rank using datastage?what is the meaning of rank?

8187


Why we use surrogate key?

699


What are transforms and what is the differenece between routines and transforms?

614


How do y read Sequential file from job control?

14415


Define meta stage?

785


How can we improve performance of data stage jobs?

616


What is meta stage?

579