masshunter reoprt builder IsQualifierResponseRatioNull issue

i run the expression about OutlierQualifierOutOfLimits.

but i find QualifierResponseRatio show to empty could cause them problems

do you have any way can fix the problem.

 

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

if BoundItems["QualifierPeak"].IsOutlierQualifierOutOfLimitsNull():
TemplateItems["Cell"].BackgroundColor = System.Drawing.Color.White
else:
if BoundItems["QualifierPeak"].OutlierQualifierOutOfLimits=="High":
TemplateItems["Cell"].BackgroundColor = System.Drawing.Color.Red
if BoundItems["QualifierPeak"].OutlierQualifierOutOfLimits=="Low":
TemplateItems["Cell"].BackgroundColor = System.Drawing.Color.DeepSkyBlue

"" if BoundItems["QualifierPeak"].IsQualifierResponseRatioNull() else BoundItems["QualifierPeak"].QualifierResponseRatio

  • Hello  ,

    In your expressions you must check for both the existence of the qualifier and the outlier yourself. In the initial if and in the final one you need to add a check to see if there is a qualifier by checking to see if it is None.

    if BoundItems[“xxx”] is None or BoundItems["xxx"].IsOutlierQualifierOutOfLimitsNull():  

     Where xxx is the name of your qualifier binding, which in your case appears to be QualifierPeak.

    The order of checks is important. If you put the null check first it will still fail. Once one part of an if … or evaluates as true no other conditions are checked.

  • Hello howard

    Thank you for the quick reply.

    I adjust initial and final expressions show to below.

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

    if BoundItems[“QualifierPeak”] is None or BoundItems["QualifierPeak"].IsOutlierQualifierOutOfLimitsNull():
    TemplateItems["Cell"].BackgroundColor = System.Drawing.Color.White
    else:
    if BoundItems["QualifierPeak"].OutlierQualifierOutOfLimits=="High":
    TemplateItems["Cell"].BackgroundColor = System.Drawing.Color.Red
    if BoundItems["QualifierPeak"].OutlierQualifierOutOfLimits=="Low":
    TemplateItems["Cell"].BackgroundColor = System.Drawing.Color.DeepSkyBlue

    "" if BoundItems[“QualifierPeak”] is None or BoundItems["QualifierPeak"].IsOutlierQualifierOutOfLimitsNull() else BoundItems["QualifierPeak"].QualifierResponseRatio

    But ,this problem still not fix.

    other compound disappeared.

    previous expressions report show to below.

    i found compound area to zero,report can't preccesing to finish.

  • Hello  ,

    In your final if statement you want to check to see if the qualifier is null, not the outlier. So you check to see if the peak exists and then you check IsQualifierResponseRatioNull().

  • I'm readjust expressions show to below.

    But i'm get same result .

    Attached is my template.

    i not have any idea for problem.

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

    if BoundItems["QualifierPeak"].IsOutlierQualifierOutOfLimitsNull():
    TemplateItems["Cell"].BackgroundColor = System.Drawing.Color.White
    else:
    if BoundItems["QualifierPeak"].OutlierQualifierOutOfLimits=="High":
    TemplateItems["Cell"].BackgroundColor = System.Drawing.Color.Red
    if BoundItems["QualifierPeak"].OutlierQualifierOutOfLimits=="Low":
    TemplateItems["Cell"].BackgroundColor = System.Drawing.Color.DeepSkyBlue

    "" if BoundItems["QualifierPeak"] is None or BoundItems["QualifierPeak"].IsQualifierResponseRatioNull() else BoundItems["QualifierPeak"].QualifierResponseRatio

    test_2.template.xml

  • Hello  ,

    In your latest expression you have removed the first check to see if there is a qualifier peak present. You need to change your first if statement to read as you had it in your previous post.

    if BoundItems[“QualifierPeak”] is None or BoundItems["QualifierPeak"].IsOutlierQualifierOutOfLimitsNull():

Was this helpful?