Assign group ID for rows

Hello all,

is it possible to assign group ID to the row of a table without scripting as in the following example?

| Item | GroupID |
| A    | 1       |
| A    | 1       |
| A    | 1       |
| B    | 2       |
| B    | 2       |
| B    | 2       |
| C    | 3       |
| C    | 3       |
| A    | 4       |
| A    | 4       |
| D    | 5       |
| B    | 6       |
| B    | 6       |
| C    | 7       |
| C    | 7       |
| C    | 7       |
| D    | 8       |
| D    | 8       |
| D    | 8       |

Or, should I use a Java/R/Python script for that?

Thank you in advance!

Roland