Record number back to 1

How to display the line number back to number 1 in the grid, where there are different groups

I need to be like this :

Group A
1
2
3

Group B
1
2
3

Right Now Scriptcase just be like …

Group A
1
2
3

Group B
4
5
6

please i need help for this problem … thanks for any of members who can solve