Display the Rank in asending & descending order for salary column

Can anybody solve this interview question in DataStage?
My input is:
EMPNO, DEPTNO, SALARY
1 A 100
2 A 4000
3 A 400
4 B 500
5 B 150
6 B 700
I need extra column "Rank" in the output is:
EMPNO, DEPTNO, SALARY, RANK
1 A 100 3
2 A 4000 1
3 A 400 2
4 B 500 2
5 B 150 1
6 B 700 3
Thanks in advance.

Questions by sai3689   answers by sai3689

Showing Answers 1 - 3 of 3 Answers

surya

  • Sep 16th, 2015
 

1. Source-->sort(dept,sal), partition (hash(dept))
2. Transformer(rank=inrownum (inrownum will be rownumber in a partition which is nothing but rank)

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions