Ok - so you are clearly aware that we have an outlier for exactly this deviation. In your Quant method - there is an outlier called 'ISTD Response Percent Deviation" with two limits Resp Min % Deviation and Resp Max % Deviation. This outlier metric is the measure of whether the internal standard response deviates more than the user defined percent limits from the average ISTD response calculated from the calibration samples (from the help, exactly what you're looking for).

Because we have the outlier defined already - you don't need to do any IF/Else logic. You can just have the outlier change the color of the cell or display Pass/Fail - whatever.

Check out the example of this in the shipping system suitability report template. If you click on the 'Resolution Front' expression - you can see the example:

Hi again - this is a little beyond my expertise but I know that Python is extremely formatting dependent. Can I set you up with one of our reporting consultants to see if they can get you an answer? If so - can you give us a call (800-227-9770, option 3, then 2) and the call center can arrange a callback for you.

It's OK. I've figured out why it's doing it now. Some sample types didn't have the outlier applied to them. this meant that the DBNull error kept coming up as there was no error to correspond to it. By limiting to Samples or Blank or CC as a fisrt arguement, the report doesn't crash: