Hi,
I need help in implementing the ranking logic in datastage version 8.0.
In my logic, I need to rank based on three columns.
Example :- column1, column2, column3. The first set will be ranked as 1 and the second set with same value will also be ranked 1 and third set with different value will be ranked 3.
I searched the forum and tried using stage variables, but having issues when I am dealing with set of columns.
Thanks
Ranking
Moderators: chulett, rschirm, roy
For doing group change detection on a "set" of columns, I've found the easiest way to do that to concatenate them all into a single delimited field. So rather than check A and B and C you check the unique combination - "A|B|C". Does that make sense? The rest is proper maintenance of the rank in stage variables and knowing by how much to increment it the next time you need to increment it.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Craig has pretty much set you on a course to handle the logic problem. Now, in my opinion, it is up to you to determine how to best handle it in DS. Think of it in terms of any programming language where you will have variables to hold results as you loop through a set of data. This is what you will do in DataStage too using stage variables.
Mike Hester
mhester@petra-ps.com
mhester@petra-ps.com