I tried using lag function to indicate when the first test for a sample ID based on time column. Need to the column, Order Tested, to represent first test conducted for a sample ID and second test based on time. Each test will have a real and maybe a code value. See attached file for JMP file. At the end of the day Order Tested column needs to look like image below. This is just a sample, real one has 10,000+ data points.