Dear all,

We are trying to make a new variable which gives every number within a consecutive series of numbers a ''name'', which is the highest number within that consecutive series. So each consecutive series starts with a ''1'' and we need to attach the highest number to every number within that series. To make this more clear see our example underneath;

Var 1 - NewVar
1 4
2 4
3 4
4 4
1 8
2 8
3 8
4 8
5 8
6 8
7 8
8 8
1 4
2 4
3 4
4 4

This might be a very basic question but we somehow can't figure out how to do it. We would be very thankful if anyone could help!

Kind regards,

Jonathan