One issue could be your incoming data is not sorted properly. Another consideration could be the number of nodes this job is running on, if it is running on more than one node you'd need make sure you hash partition properly on the value(s) you are using to check for duplicates.
So... what exactly about this doesn't seem to be working for you?
-craig
"You can never have too many knives" -- Logan Nine Fingers
So... in other words, exactly what's already ready been posted as being used.
Me, personally, I would rely on the expression automatically assigning the proper values, there's no need to do it "manually". Then treat the result as the Boolean it is.
IsDup: DSLink2.deptno = LastValue
Constraint: Not(IsDup)
-craig
"You can never have too many knives" -- Logan Nine Fingers
ravi7487 wrote:I got the output correct ... but, i do not want to initialize currentvalue as manually. any alternative mthod? pelase let me know
Is there any particular reason WHY you don't want to initialize currentvalue "manually"? It's both perfectly acceptable and is the correct method per standard programming practices in almost any programming language. There is no need or reason to use any alternative methods to accomplish this job.
- james wiles
All generalizations are false, including this one - Mark Twain.
As noted, you are not "manually" initializing them, you are properly initializing them using the mechanism provided for exactly that purpose. Make sure you understand, however, that it doesn't need to be a hard-coded value there, you can use an expression or function or job parameter there for example.
ps. There's no need to initialize IsDup since it is set before ever being tested. Doesn't hurt, of course, but serves no purpose.
-craig
"You can never have too many knives" -- Logan Nine Fingers
Thank you all for replying,
so, when comparing the values in transoformer,
for the first incoming row to transformer, the initial value for the "previousvalue" should be assigned something that will not match with the first incoming row.