Hey , By using your solution I am able to get the rows ij correct numbers but when it goes for the next record it continues the row count from there .
EX: Record 1 has 4 rows so rows will be 2, 5 , 8 ,1 1
Record 2 has 1 row , So, it is giving row number 14 instead of 2 , I want to start each new record with 2. and then have to increment values.