Hi Friends,
I have a input data like,
class_id Marks
101 50
101 60
101 40
102 90
102 35

And i want my output data like
class_id Marks Rank
101 50 2
101 60 1
101 40 3
102 90 1
102 35 2

how to do this in datastage?

Answer Posted / abhay agrawal

Source--Tx--Target

In  Tx have 5 Stage Variables:
PreSID
CurrSID
PreMarks
CurrMarks
Rank

CurrSID=>PreSID
Input Sid=>CurrSID
CurrMarks=>PreMarks
Input Mark=>CurrMarks
If CurrSID=PreSID then If CurrMarks=PreMarks then Rank Else Rank+1 Else 1=>Rank

Take Rank as output column, let me know if any clarificationneeded.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Demonstrate experience in maintaining quality process standards?

1939


What is a merge?

672


What are the components of datastage?

656


Have you used Unstructured data?

836


for example You have One Table with 4 Columns (Mgr ID, Department ID, Salary, Employee ID). Can you find out the Average Salary and Number of Employee present per Department and Mgr

779






project Steps,hits, Project level HArd things,Solved methods?

1638


Difference between ‘validated ok’ and ‘compiled’ in data stage?

677


What is the difference between informatica and datastage?

658


What is orabulk stage?

636


What are the different type of jobs in datastage?

608


Can you explain how could anyone drop the index before loading the data in target in datastage?

896


how to read 100 records at a time in source a) hw is it fr metadata Same and b) if metadata is nt same?

1720


Terminate Activity

841


Differentiate between hash file and sequential file?

585


Why do you need stage variables?

664