One Star

How to Auto-Increment in tMap

Hi Guys,
Im trying to do something which I think is pretty simple but I cant get it to work.
Ive got for example, ids - a,a,a,a which increments from 1,2,3,4 using Numeric.sequence("s1 ",1,1), this is ok.
However when I move onto ids - b,b,b the increment continues to 5,6,7 while I need it to start from 1 again. Can someone please help?
Thanks,
Adrian
1 REPLY
One Star

Re: How to Auto-Increment in tMap

Hello adrianorirl,
Create a variable (var2) with this expression :
Var.var2==0 || Var.var2>=4 ? 1 : Var.var2+1
I've tested it, it works well.
Regards,
JC