I have this machine where you can process a material over and over until it becomes a product.

The INPUT of the machine looks like this:

DateI         Code     #Orderofday
25/02/2019    A0001    1
25/02/2019    B0001    2   
27/02/2019    B0002    1
28/02/2019    A0002    1
01/02/2019    B0004    1
01/02/2019    B0003    2
01/02/2019    B0005    3

And the OUTPUT looks like this:

DateI         Code     #Orderofday
25/02/2019    B0001    1
25/02/2019    B0002    2
27/02/2019    B0003    1
28/02/2019    B0004    1
01/02/2019    B0005    1
01/02/2019    WINSOR   2
01/02/2019    APRSHA   3

As you can see from the tables, A0001 in the INPUT is processed to become B0001 in the OUTPUT. And then B0001 becomes the INPUT and get processed again to become B0002 etc.

The starting material has a Code column that always begins with a letter "A" followed by 4 numbers, the middle-process always begins with "B" followed by 4 numbers, and the final product are other combination of letters. There is no fixed amount of middle-processes a material has to go through to become a product.

I want to get rid of the middle-process (the Code that starts with "B") to make the final result to look like this:

matco     product
A0001     APRSHA
A0002     WINSOR

Is there anyway to do this? Much appreciated

0 Answers