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
How to reverse the string using SQL?
What are constraints and derivations?
How to convert RGB Value to Hexadecimal values in datastage?
how to implement scd2 in datastage 7.5 with lookup stage
What are the types of jobs we have in datastage?
Where do you see different stages in the designer?
What is developer responsibilities in UAT (user acceptance testing and Post implementation phase?
Why we use surrogate key?
What is the difference between account and directory options ?
How do you register plug-ins?
Can we use target hash file as a lookup ?
Differentiate between datastage and informatica?
What is a merge in datastage?
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)
How do you generate sequence number in datastage?