Here are 2 solutions to the issue. The first one changes the calculation to use the min and max values for the particular Well Position that is being evaluated.
Data Table( "Melt Curve Raw Data" ) << New Column( "Normalized Fluorescence",
formula(
(:Fluorescence - Col Min( :Fluorescence, :Well Position )) / (
Col Max( :Fluorescence, :Well Position )
-Col Min( :Fluorescence, :Well Position ))
)
);
Data Table( "Melt Curve Raw Data" ) << Subset(
By( :Well Position ),
All rows,
Selected columns only( 0 ),
columns( :Temperature, :Fluorescence, :Normalized Fluorescence )
);
Data Table( "Melt Curve Raw Data" ) << delete columns( :Normalized Fluorescence );
The second one creates the subsetted data tables, and then goes back and add the new column for each of the new data tables produced
new tables = Data Table( "Melt Curve Raw Data" ) <<
Subset(
By( :Well Position ),
All rows,
Selected columns only( 0 ),
columns( :Temperature, :Fluorescence, :Normalized Fluorescence )
);
For( i = 1, i <= N Items( new tables ), i++,
new tables[i] << New Column( "Normalized Fluorescence",
formula(
(:Fluorescence - Col Min( :Fluorescence, :Well Position )) / (
Col Max( :Fluorescence, :Well Position )
-Col Min( :Fluorescence, :Well Position ))
)
)
);
Jim