# custom calculation bracketing overlap

Hello,
Can we write a formula to calculate the average of the areas of the calibrating standards framing the tests in overlap bracketing mode. I would like for example average(area1;area2) and average (area2;area3)
std1 cal : area1
lot1
lot2
std1 cal : area2
lot3
lot4
std1 cal : area3

syb

• Hello,

Yes but you will need to create an index first for the Calibration injections. I used the 2 CCs below to do the calculation. The first one create an index for all calibration injections the second uses the index to find each bracket. In the example below I used index + 1 so the first injection has the value of the average for the first bracket. The average for the last Cal injection will just be itself. You could change the behavior by using - 1.

CurrentSequence.AllInjections.Where(function (x) x.Sample.Sample_Type = 1).OrderBy(function(x) x.Sample.Sample_OrderNumber).Select(function(x) x.Sample.Sample_OrderNumber).Distinct.ToList.FindIndex(function(x) x=Sample_OrderNumber)+1

CurrentSequence.AllIdentifiedPeaks.Where(function (x) x.Compound_Name = CurrentPeakorGroup.Compound_Name).Where(function(x) x.Injection.Sample.Sample_Type = 1).Where(function(x) x.Injection.GetIntegerCC("CIndex") = CurrentInjection.GetIntegerCC("CIndex") OR x.Injection.GetIntegerCC("CIndex") = CurrentInjection.GetIntegerCC("Cindex")+1).Select(function(x) x.Peak_Area).Average • thank you very much,

at first it did not work because I forgot to set the type to "integer", I left it in "double",but now everything  is ok

syb