Subset with added formula column - almost thereI am trying to create a script to subset data which also adds a column with a formula in it. I am close (sort of). I can create the subset, with the new column, but the new column only has dots in it.
Here is what I have so far:
Data Table( "Melt Curve Raw Data" ) << Subset(
By( :Well Position ),
All rows,
Selected columns only( 0 ),
columns( :Temperature, :Fluorescence, New Column( "Normalized Fluorescence", formula(
(:Fluorescence - Col Min(:Fluorescence )) / (Col Max(:Fluorescence )
-Col Min(:Fluorescence )))
))
);
After searching, I saw something about an eval command, but as a beginner I can't figure out how to add it in so it works.
**Ideally I would also be able to add the new column directly after the Temperature column instead of at the end
Thank you in advance for any advice!!
Data TableScriptingRe: Subset with added formula column - almost thereHi Jim! Thank you for your advice. I wish I could use your method, but unfortunately, when I add the column before doing the subsets, the new column uses the previous max & mins so the calculations are wrong.
Adding the new column after the subset works for me, not sure why, and it is correctly titled, but the formula doesn't "calculate" which is why I thought it might be the "eval" thing I've seen. When I go into the new columns, it has "suppress eval" on but I don't know how to fix that without going in by hand to all of the subsets and correcting it.
I attached a screenshot of what it looks like to me. The column appears, but with the dots. When I go into column info, it has the "suppress eval" checked, and unchecking it solves the error, but it's not ideal to have to go into all of the subsets individually to uncheck the box. I tried adding different codes to the script to turn off suppress eval, but none of them work so far.