How to create a formula with calculations of custom fields values in OpenLab CDS

Hi 

 

am developing an intelligent report for quantification in OpenLAB CDS 2.4 and I want to include an acceptance criteria in my results table. The acceptance criteria will pass if the compound amount is within +/- 10% of a reference value.

 

I was able to do so when only one analyte is quantified (typing the reference value in  the sample amount section) using the following expression:

=Iif(Compound_Amount<=(Sample_Amount-(Sample_Amount*0.1)), Compound_Amount>=(Sample_Amount+(Sample_Amount*0.1)),"Pass"

 

However, I haven't been able to create a formula for when several analytes are quantified. I've created a compound custom parameter "Expected amount" to be able to give reference values to each of the quantifiable analytes and I have been able to use the expression to calculate accuracy but I need help creating the formula for the acceptance criteria.

 

=Iif(Compound_Amount<=(CFE((Compound_CustomFields),"ExpectAmt")-(0.1*CFE((Compound_CustomFields),"ExpectAmt"))), Compound_Amount>=(CFE((Compound_CustomFields),"ExpectAmt")+(0.1*CFE((Compound_CustomFields),"ExpectAmt"))),"Pass")

 

Thank you for your time

Parents
  • Yes, the type is Numeric although I do not have a default value set up as it changes for each of the compounds detected.

     

    Regarding the expression, it does not work including the Val() function

    =IIf(Compound_Amount<=Val(CFE((Compound_CustomFields),"ExpectAmt"))-Val((CFE((Compound_CustomFields),"ExpectAmt"))*0.1),"FAIL",IIf(Compound_Amount>=Val((CFE((Compound_CustomFields),"ExpectAmt"))+(Val(CFE((Compound_CustomFields),"ExpectAmt"))*0.1)),"FAIL", "PASS"))

     

    This is an error that appeared in the Expression editor when I used your second option:

     

    =IIf(Compound_Amount<=Code.Code.CFE.CFE\.Code.CFE.CFE\(\(Compound_CustomFields\),"ExpectAmt"\,"String","String")-(Code.Code.CFE.CFE\.Code.CFE.CFE\(\(Compound_CustomFields\),"ExpectAmt"\,"String","String")*0.1),"FAIL",IIf(Compound_Amount>=(Code.Code.CFE.CFE\.Code.CFE.CFE\(\(Compound_CustomFields\),"ExpectAmt"\,"String","String")+(Code.Code.CFE.CFE\.Code.CFE.CFE\(\(Compound_CustomFields\),"ExpectAmt"\,"String","String")*0.1)),"FAIL","PASS"))

  • Try using CDbl() insted of Val(). The latter had stopped working for me after some OpenLab update for whatever reason.

     

    The type of a Custom Parameter is always 'string' for the code no matter what you set in the Project settings. The project settings just define the input field validator.

     

    The code for extracting a CFE value should be the following:

    Code.CFE.ExtractValue((Compound_CustomFields),"Amount","String")

Reply
  • Try using CDbl() insted of Val(). The latter had stopped working for me after some OpenLab update for whatever reason.

     

    The type of a Custom Parameter is always 'string' for the code no matter what you set in the Project settings. The project settings just define the input field validator.

     

    The code for extracting a CFE value should be the following:

    Code.CFE.ExtractValue((Compound_CustomFields),"Amount","String")

Children
No Data
Was this helpful?