Report Builder System Suitability Expression

Data set from batch.bin works for S/N in shipping system suitability template.  The expression for S/N was directly copied and pasted and all Field Caption/Field Values were replicated to match the system suitability template for S/N.  But this error displays with the exact same data set:

Not sure how to troubleshoot this.

  • This is the expression:  

    import System
    import clr
    clr.AddReference("System.Drawing")
    import System.Drawing

    if BoundItems["TargetCompound"].IsMinimumSignalToNoiseRatioNull() or BoundItems["TargetPeak"] is None or BoundItems["TargetPeak"].IsSignalToNoiseRatioNull() or BoundItems["TargetPeak"].IsOutlierSignalToNoiseRatioBelowLimitNull() or BoundItems["TargetPeak"].SignalToNoiseRatio=="Infinity" :
    TemplateItems["Cell"].BackgroundColor = System.Drawing.Color.White
    else:
    if BoundItems["TargetPeak"].OutlierSignalToNoiseRatioBelowLimit=="Low":
    TemplateItems["Cell"].BackgroundColor = System.Drawing.Color.DeepSkyBlue

    "" if BoundItems["TargetPeak"] is None or BoundItems["TargetPeak"].IsSignalToNoiseRatioNull() else BoundItems["TargetPeak"].SignalToNoiseRatio

  •  ,

    Make certain when you are copying and pasting expressions that you are not adding carriage returns/line breaks or removing the indentations needed by Python that indicate code blocks. I believe all of the expression examples in the shipping templates use three spaces for the code blocks. This must be consistent throughout a given expression. 

    It is difficult to cut and paste code here since the formatting will be shifted, but this is a screen shot of what the original expression looked like. Make certain that when you paste it and expand the window it is identical.

  • Yes, I did make certain it is identical and I certainly didn't add anything or remove anything.  I've tried it MANY times and get the same error.  

  •   ,

    I was able to duplicate the problem by copying the expression from the SystemSuitability template into a modified Gen_Complete_ISTD template. The issue is that the binding names in that table in Gen_Complete_ISTD template are slightly different from the binding names in the SystemSuitability report.

    In SystemSuitability the binding is named 'TargetCompound'.

    In Gen_Complete_ISTD it is named 'TargetCompounds'.

    So, change the first part of the expression to

    BoundItems["TargetCompounds"].IsMinimumSignalToNoiseRatioNull()

    and the expression will work.

  • YES!  That worked!  I hadn't considered something like that since I had thought that the choice of binding names was set (as outlined in the Schema) and it seems like it would be "TargetCompound." 

    I just assumed any deviation from that like "TargetCompounds" wouldn't be recognized. 

    I meant to ask--what does "NaN" signify for Resolution exactly?  I haven't been able to find this information anywhere.  I'm used to System Suitability Reports just giving me numerical values for this parameter.  This report did give me values for Resolution Front (but the resolution from the peak in front of my analyte of interest is < 2.0).  There is a lot of distance between my analyte of interest and the peak following it (Resolution Rear) and this is where I am getting "NaN." 

    Thanks!

  • Hi  ,

    'NaN' stands for 'Not a Number' and generally means that the value returned is not a real or finite number, or that the number is larger than the variable type can hold. This is most common in data analysis where the result of a calculation is infinity due to dividing by zero or possibly where one of the values is NULL or doesn't exist.

    For either Resolution Front or Rear this can occur if there is only one peak in the data extraction window. Since this calculation requires data for two peaks, a real and finite value cannot be calculated if only one peak is found. 

Was this helpful?