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

Describe the architecture of datastage?

568


Hi, what is use of Macros,functions and Routines..? At what situation you are used. If you know the answer please explain it. Thanks.

1615


how to abort the job its matain duplicates?

2102


Define APT_CONFIG in Datastage?

664


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

611






If you want to use a same piece of code in different jobs, how will you achieve this?

791


what are the devoleper roles in real time? plz tell i am new to datastage....

1637


How do you start developing a datastage project?

660


Hi,can any one please mention list of dimension and fact tables for Sales and Distribution System for a Pharmacutical company.

1665


Differentiate between hash file and sequential file?

578


Explain datastage architecture?

815


Hi , Can anyone give few examples of scenarios and there corresponding design in datastage..i am new to this tool...confused in design while my manager asking to design the job.. Please post the URL if there..so i can go through it.. Thanks in advance...

3756


how to delete one row in target dataset

2586


What are the processing stages?

640


What is the difference between account and directory options ?

620