This script seems to be what you want. It could be turned into a formula if you would prefer that
Names Default To Here( 1 );
dt = New Table( "Untitled 13",
Add Rows( 12 ),
New Column( "ID",
Character,
"Nominal",
Set Values( {"10", "10", "10", "10", "11", "11", "11", "11", "12", "12", "12", "12"} )
),
New Column( "Process Step",
Character( 16 ),
"Nominal",
Set Values(
{"Drying", "Spawned", "Drying", "Finished", "Drying", "Spawned", "Drying", "Finished", "Drying", "Spawned", "Drying",
"Finished"}
)
),
New Column( "Process Time",
Numeric,
"Nominal",
Format( "h:m", 12 ),
Input Format( "h:m" ),
Set Values( [32400, 34200, 36000, 39600, 7200, 9000, 9900, 14400, 27000, 27900, 28800, 32400] )
)
);
dt << New Column( "Category", Character );
For( i = 1, i <= N Rows( dt ), i++,
currID = dt:id[i];
If( i == 1,
spawnTime = dt:Process Time[(dt << get rows where( dt:id == currID & dt:Process Step == "Spawned" ))[1]]
);
If( i > 1,
If( dt:ID[i] != dt:ID[i - 1],
spawnTime = dt:Process Time[(dt << get rows where( dt:id == currID & dt:Process Step == "Spawned" ))[1]]
)
);
If( dt:Process Time[i] <= spawnTime,
dt:Category[i] = "Synthesis",
dt:Category[i] = "Processing";
);
);
The script assumes the data are sorted by ID. However, if the spawnTime was freshly calculated for each loop through the data, the table would not have to be sorted. It would slow the script down, calculating the SpawnTime on each loop, but that might be a tradeoff you want to make.
Jim