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. 

  •  ,

    I also meant to explain difference between Binding name and Data name. 

    When you name a binding in Report Builder you are specifying a variable name that you are going to use in that report or report section to reference an extraction from a given Data table. It is the Data table names from the quant database, as given in the data set manual, that are fixed and cannot be changed. In the shipping templates, in some cases, it was decided to name the binding the same as the data name, and this is where it can be a little confusing. 

    For example, this binding is named 'ISTD' and is made of information from the TargetCompound Data table.

    But the TargetQualifer binding name was chosen to be the same as the Data table name since it is a reasonable description of the information being retrieved.

    Keep this in mind when copying code from one template to another and also when naming your own bindings. 

Was this helpful?