Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hello,
I'm looking to increment a field based on another field in a TMAP with
I would like to increment each line having the same value in the second field.
I think you have to use the command Numeric.resetSequence("s1",1) but I don't know how to insert the condition
In the input file, i have
AAA
AAA
AAA
BBB
BBB
BBB
And the expected result
AAA 1
AAA 2
AAA 3
BBB 1
BBB 2
BBB 3
Thank you for your feedback
Hello,
If you want to use one sequence for each product(AAA, BBB,CCC)
For example, if your main input is row1 and the input first field is product
Numeric.sequence(row1.product,1,1).
Hope it helps.
Best regards
Sabrina
Hi @Service IT Vivo group , you just have to put Numeric.Sequence("S1",1,1) in an output field of data type int of a tMap,
you just have to remind that when you create a sequence and you want to use it in another part of the job it won't be reset and continue to increment, you have to reset it first. If you just want to use it in one part of the job you just have to use Numeric.Sequence("S1",1,1) , with "S1" the name of the sequence, 1 the start value and another 1 the increment value.
Send me love and kudos.
Hi,
Thanks, but that doesn't solve my problem.
With Numeric.Sequence("S1",1,1)
I end up at the output with a file
AAA 1
AAA 2
AAA 3
BBB 4
BBB 5
BBB 6
I want the increment to reset automatically when the first field changes (AAA becomes BBB then CCC...)
AAA 1
AAA 2
AAA 3
BBB 1
BBB 2
BBB 3
CCC 1....
Hello,
If you want to use one sequence for each product(AAA, BBB,CCC)
For example, if your main input is row1 and the input first field is product
Numeric.sequence(row1.product,1,1).
Hope it helps.
Best regards
Sabrina
Hello,
this is exactly that i want.
Thank you!
Hello,
Great it helps. Feel free to let us know if there is any further help we can give.
Best regards
Sabrina