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

How to reverse the string using SQL?

881


What are constraints and derivations?

640


How to convert RGB Value to Hexadecimal values in datastage?

3448


how to implement scd2 in datastage 7.5 with lookup stage

5117


What are the types of jobs we have in datastage?

660






Where do you see different stages in the designer?

624


What is developer responsibilities in UAT (user acceptance testing and Post implementation phase?

1628


Why we use surrogate key?

691


What is the difference between account and directory options ?

613


How do you register plug-ins?

591


Can we use target hash file as a lookup ?

2806


Differentiate between datastage and informatica?

711


What is a merge in datastage?

758


1)what is the size of Fact table and dimension table? 2)how to find the size of Fact table and dimension table? 3)how to implement the surrogate key in transform stage? 4)write the configuration file path? 5)how many types of datasets explain? 6)diff b/w developed projects and migration projects? 7)how to delete the header and footer file of the sequencer file? 8)how can u call the parameters in DS in unix environment? 9) how much data ur getting daily ? 10)

2303


How do you generate sequence number in datastage?

617