Here is my take on solving the problem. It handles the cases where either the Max Measurement is an even number, and therefore an exact row to get the Half Time from exists, or if the Max Measurement is an odd number, it will interpolate the Time value to come up with the Half Time value
Names Default To Here( 1 );
dt = Data Table( "Data" );
dtSum = dt << Summary(
Group( :Sample, ),
Max( :Measurement ),
Freq( "None" ),
Weight( "None" ),
Link to Original Data Table( 0 ),
Output Table( "The Summaries" )
);
dtSum << New Column( "Half Max Measure", Set Each Value( :Name( "Max(Measurement)" ) / 2 ) );
dtSum << New Column( "Time At Half Measurement", Format( "h:m:s" ) );
// Get the Half Max Measure
For( i = 1, i <= N Rows( dtSum ), i++,
theRow = dt << get rows where(
dt:Sample == dtsum:Sample[i] & dt:Measurement == dtSum:Half Max Measure[i]
);
If( N Rows( theRow ) > 0,
dtSum:Time At Half Measurement[i] = dt:Time[theRow[1]]
,
// No Measurement was taken at exact Half Time, so interprolate the finding
rowBefore = Max(
dt << get rows where(
dt:Sample == dtsum:Sample[i] & dt:Measurement > dtSum:Half Max Measure[i]
)
);
rowAfter = Min(
dt << get rows where(
dt:Sample == dtsum:Sample[i] & dt:Measurement < dtSum:Half Max Measure[i]
)
);
ratio = (dt:Measurement[rowBefore] - dtSum:Half Max Measure[i]) / (dt:Measurement[
rowBefore] - dt:Measurement[rowAfter]);
dtSum:Time At Half Measurement[i] = dt:Time[rowBefore] + ratio * (dt:Time[rowAfter] -
dt:Time[rowBefore]);
);
);
Jim