Custom calculation using peak areas from different detectors in GPC software.

Hi, my lab has recently converted to CDS 2.5 and I'm trying to automate some calculations that we are currently doing in excel. I need to do two separate calculations but I cannot get a result. The calculation requires the concentration, so I was hoping to use the sample and internal standard amount or sample custom parameters to input weights and have the concentration calculation also automated. 

The first calculation uses the RID peak area and should be (PeakArea/(Constant*0.185))/(concentration*0.1)*100.                   The concentration is (sample amount*1000)/(InternalStdAmount/0.8892)

On the custom calculation front, I've tried (SUM("Peak_Area",CurrentInjection.SignalByName("RID1A").AllPeaksAndGroupsInRange(11,20))/(72173445*0.185))/(((Sample_Amount*1000)/(CurrentSample.InternalStandardAmount(1)/0.8892))*.1)*100. 

I can't get this to work. I have the type as "double" and I've tried the identifier on multiple different levels. 

Since I haven't had any luck using the custom calculations, I next attempted to just add this calculation into my report table. I added a custom column to the report table and then in the column properties I've added the following function as a value: 


This gives an error, I think because I can't find a way to reference the internal standard amount as a number rather than a list. The description of the internal standard fields in the report column editor makes it seem like they all return lists. Any help would be greatly appreciated!

  • I can't find a way to actually use the standard calibration workflow with the GPC software. That would be fantastically easier and take out most of the calculation itself, but it seems like where EZChrom had that capability and it was apparent, CDS either doesn't have it or it isn't readily apparent. 

  • Hello,

    I am not sure exactly what you are trying to do with the calculations. Is there a reason you are not using the standard calibration workflow in Openlab 2.x. In IR the internal standard amount would need to be defined in the expression as Val(Choose(2,Split(Choose(1,Split(Sample_DAInternalStandardAmounts,";")),"="))) to use it as a numeric value. If you needed IS 2 the second choose value would need to be changed to 2 or the IS you want to pull. You can use both Sample or Injection in the name as they both work currently. 

    Marty Adams

  • You should look at upgrading to CDS 2.7. In CDS 2.6, the ability to have a GPC method with standard GC/LC quantitation workflows was added.

    Marty Adams

  • This update is a global company wide project to move to CDS 2.5, so 2.7 is not an option. 2.5 has been chosen as our global MET. I've tried the code that you suggested, but I'm still not able to get a result. 

  • I figured out this issue for myself and want to share the workaround I found. It's clunky, but it does work. 

    I set mandatory numerical sample custom parameters in the control panel with a default value of 1. 

    In the report editor, I added an invisible column to the beginning of my peak results tables. The invisible column pulls in the sample parameters using the following formula in the value expression editor (where the parameter name is the name given in the control panel to the sample parameter):

    =CFE((Sample_CustomFields),"Parameter Name")

    These sample parameters can be multiplied by each other, but not by real numbers at this point. Once the formula is right in the expression editor, Save Expression Result As and save as a variable with a variable name. This variable is now a double, can be called into future calculations by typing the variable name and hitting enter when it appears, and it can be treated as a number.

    Added visible columns to the end that hold calculations using the variable I made. 

  • Hello,

    You should be able to use custom fields directly in calculations by converting them to a number by using Val(), =Val(CFE((Sample_CustomFields),"Parameter Name")). This is why when using the IS I have Val in the expression. Val(Choose(2,Split(Choose(1,Split(Sample_DAInternalStandardAmounts,";")),"="))) The software will try to convert data types for you and has gotten better in later versions, but I always try and include the conversion in the expressions.

    Marty Adams

Was this helpful?