HI,
I was trying to use RowProcCompareWithPreviousValue and am getting wrong results it always returns 1 as a return value even if there is a difference in the Value. Is there any restriction in using this Transforms. Do I need to use only String as datatype or use only tables to compare?
I tried to take a Seq File and sort it and Compare the Previous value and assigning a running no for the Records.
Cheers
Error while using Transforms RowProcCompareWithPreviousValue
Moderators: chulett, rschirm, roy
Error while using Transforms RowProcCompareWithPreviousValue
Victor Auxilium
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Have you read the caveat in the long description of the Transform? In particular, are you using the same Transform more than once in the same process-chain in the job?
You may find it easier/better to use a pair of stage variables in a Transfomer stage to detect change; and this approach does not use COMMON, one of the contraindicators for using row buffering.
Variables might be called varHasChanged and varPrevValue. The varHasChanged variable is declared earlier than varPrevValue. varHasChanged is initialized to @FALSE, varPrevValue is initialized to anything you like. Derivation expressions are:
Of course, this approach relies upon the input stream being sorted by values of colname.
You may find it easier/better to use a pair of stage variables in a Transfomer stage to detect change; and this approach does not use COMMON, one of the contraindicators for using row buffering.
Variables might be called varHasChanged and varPrevValue. The varHasChanged variable is declared earlier than varPrevValue. varHasChanged is initialized to @FALSE, varPrevValue is initialized to anything you like. Derivation expressions are:
Code: Select all
varHasChanged: InLink.colname <> varPrevValue AND @INROWNUM > 1
varPrevValue: InLink.colname
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Hi all,
Maybe should i create a new topic but i want to let you what i found with RowProcCompareWithPreviousValue.
I use it to eliminate duplicate records in a transformer.
The strange thing is that sometimes i had false duplicate.
I changed to the two variables way but the results was the same.
I resolved the problem by changing the order of the "key"
Maybe should i create a new topic but i want to let you what i found with RowProcCompareWithPreviousValue.
I use it to eliminate duplicate records in a transformer.
The strange thing is that sometimes i had false duplicate.
Code: Select all
ex
330285131|20081130
330285131|20081230 --> 0
330285131|20081231 --> 1 (witch it's wrong).
I resolved the problem by changing the order of the "key"
Code: Select all
ex
20081130|330285131
20081230|330285131 --> 0
20081231|330285131 --> 0 (ok now).
Hope This Helps
Regards
Regards