Page 1 of 1

Capture Duplicate Records

Posted: Wed Dec 20, 2006 12:13 am
by deepak.shanthamurthy
Hi
am trying to capture duplicate records
i have sorted the records on the key
and am using the following code as stage variables.

Var = Key
flag = If Var = Var2 Then "Duplicate" Esle "NO"
Var2 = Var

But this is not giving me the results

Though i see in my debugger that var2 is retaining the old value of var the flag is always being set to Duplicate!!!!!

not sure where the problem is ???

Any help is appreciated

Thanks

Posted: Wed Dec 20, 2006 1:58 am
by kumar_s
If Var2 (Previous record) is same as Var (current record), it should give you "Duplicate".

Posted: Wed Dec 20, 2006 4:14 am
by ray.wurlod
You should get "duplicate" when the value of Key is the same as in the previous row. And, with the logic you've stated (ignoring the typo for Else) you should get "NO" when the value of Key is different from that in the previous row. If this isn't happening, check your work, particularly your stage variable names, closely.