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
What is usage analysis in datastage?
How a source file is populated?
How do you import and export data into datastage?
Can we use target hash file as a lookup ?
Which algorithm you used for your hashfile?
What is the command line function to import and export the ds jobs?
Explain datastage architecture?
what is stage is used for below Input columns: dept|mgr|employee|salary Output columns: mgr|count of employee per mgr|avg salary per dept note: each dept has one mgr and each mgr has many employees
What are the partitioning techniques available in link partitioner?
How to reverse the string using unix?
What are the types of views in datastage director?
Why fact table is in normal form?
What are system variables and sequencers in datastage
How do you schedule or monitoring the job?
What are the areas of application?