Hi guys
I have a dataset which has the variable 'job_ID'. This variable starts from 1 and increments down each row and will end around number 50 (will change each time). This 'Job_ID' represents each job in a batch of jobs.
I want to create a new variable called 'batch_ID'. This should start from 1, then continue to be number 1 all the way down the 'Job_ID' variable until it gets to the number 1 again - then the batch_id should increment to 2 and so on.
An example of what I want the 'batch_id' to look like is this:
job_id job_name batch_id
1 1.0 1
2 1.1 1
3 1.2 1
4 1.3 1
1 1.0 2
2 1.1 2
3 1.2 2
1 1.0 3
2 1.1 3
and so on.
Any help much appreciated.
Cheers
jamie
I have a dataset which has the variable 'job_ID'. This variable starts from 1 and increments down each row and will end around number 50 (will change each time). This 'Job_ID' represents each job in a batch of jobs.
I want to create a new variable called 'batch_ID'. This should start from 1, then continue to be number 1 all the way down the 'Job_ID' variable until it gets to the number 1 again - then the batch_id should increment to 2 and so on.
An example of what I want the 'batch_id' to look like is this:
job_id job_name batch_id
1 1.0 1
2 1.1 1
3 1.2 1
4 1.3 1
1 1.0 2
2 1.1 2
3 1.2 2
1 1.0 3
2 1.1 3
and so on.
Any help much appreciated.
Cheers
jamie