Custom Calculation between two areas in different samples

Hi, 

I am trying to make a custom calulation in Open Lab CDS 2.5.

From a sequence consisting of two samples (REF_STD and REF_KAL) 

with both having peaks relating to 1,4-Dioxane and propylbenzene. 

I want the custom calculation of the following formula:

However, I am struggeling to find/ understand the right syntax so that I get to select the right values.

I hope you can help me.

Parents
  • Hello,

    It looks like you are creating this at a sequence level scope so an example of doing a simple fairly static calculation would be as follows. This example would take the average peak area of peak A from all injections with the name SSS and divide that by the average area of peak B for injections with the name CSS. The where statements are the filters and the select is the data you would like to extract. These CC would be scope of sequence and type double.

    CurrentSequence.AllIdentifiedPeaks.Where(function(x) x.Compound_Name = "Peak A").Where(function(x) x.Injection.Sample.Sample_Name = "SSS").Select(function(x) x.Peak_Area).Average / CurrentSequence.AllIdentifiedPeaks.Where(function(x) x.Compound_Name = "Peak B").Where(function(x) x.Injection.Sample.Sample_Name = "CSS").Select(function(x) x.Peak_Area).Average

    If you needed the 1st multiplier of a specific injection you could get that with a CC like.

    CurrentSequence.AllIdentifiedPeaks.Where(function(x) x.Injection.Sample.Sample_Name = "SSS").Select(function(x) x.Injection.Sample.Multiplier(1)).Average

    Marty Adams

Reply Children
Was this helpful?