I need generate the sequence numbers based on the same value in the data stage. Tried using the sequence number generator but it is create sequence numbers but not generating based on the same value.
and also tried using the seq generating numbers in the transformer stage and that one also not working.
you have to use stage variable in the transfomer to get this done.Which I think is the easiest way to perform(though !!! there are lot of ways)
In the transformer have 4 stage variable
Assign a stage variable 1 = cntvariable as 0
prevrec=currentrecord
currentrecord={ the input from the source}
SameRecChck=If the previous rec is equal to the current records increment the counter else 0
Before you input the records to the transformer ..sort the input columns without fail.
Thanks for the valuable suggestion. Tried same in the transformer stage with four variables but the output not same.
Assign a stage variable 1 = cntvariable as 0
prevrec=currentrecord
currentrecord={ the input from the source}
SameRecChck=If the previous rec is equal to the current records increment the counter else 0
naveenkumar.ssn wrote:The above logic would definitely work !!!
They would stand a better chance of working if you order the stage variables properly.
And you only need two:
svCount: If InputValueFromLink = svPrevVal then svCount+1 else 1
svPrevVal: InputValueFromLink
Your sorting will affect this as will your partitioning so make sure those are correct as well. You can also use a Sort stage with the Key Change property set before this so that your check only requires one stage variable.
-craig
"You can never have too many knives" -- Logan Nine Fingers