Repeater - last item with specific value

Hello! I have two repeaters next to each other. First is simple with Group names, second contains subgroups.
Each group can have multiple subgroups, so the row heights of first repeater change when somebody adds a subgroup.

I wanted to put a graphic division line between subgroups of each group.

Is there any way to get Y of last row that has particular group value?

Repeaters look like this:
Group 1
Group 2
Group 3

Subgroup groupId
subgroup11 1
subgroup12 1
subgroup21 2
subgroup31 3
subgroup32 3`


It might help if you posted what you want the output to look like because it’s a bit hard to picture, but I think I see what you are trying for.

Try this, with a hidden line at the top of your repeater row where you want to show the lines. (You shouldn’t need the Y.)

   If (value) [[Item.isFirst]] equals true
     set variable v_groupname to (value)  [[Item.GroupName]]
   If variable v_groupname is not equal to (value) [[Item.groupName]]
     show line
     set variable v_groupname to (value) [[Item.GroupName]]

Make sure that second condition is an IF, not an ELSE IF.