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: 

=(Peak_Area/72173445*0.185)/((Sample_Amount*1000/(Injection_DAInternalStandardAmounts/0.8892))*.1)*100 

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!

Parents
  • 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. 

Reply
  • 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. 

Children
  • 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?