Custom calculation to compare peak area in blank run to peak area in a standard run. Not working for 1 injection. Help?

I am using a custom calculation to determine if the peak area in a run is < the peak area in another run. My calculation code works perfectly for all of my samples except for the 1st blank (see snip of my report below). I believe this has to do with the sequence of injections. The sequence is as follows:

1. Blank

2. Detection limit standard

3. Quantitation limit standard

4. Cal std 1

5. Cal std 2

6. etc....7....8....

9. Blank

10. more samples and blanks....

Is there a way to make my code determine if Peak_Area < Peak_Area of my reporting limit standard for the 1st blank of the sequence? The reporting limit standard is defined as a spike, Sample_Type=15.

CC Code:

If(Sample_Type=5,If(Compound_Name.Length < 1, "N/A", If(Peak_Area < CurrentSequence.AllIdentifiedPeaks.Where(function (x) x.Injection.Sample.Sample_Type = 15).Where(function (x) x.Compound_Name = "CONFIDENTIAL").Where(function(y) y.Injection.Sample.Sample_OrderNumber<CurrentSample.Sample_OrderNumber).OrderBy(function(x) x.Injection.CreationTime).Select(function(x) x.Peak_Area).Last,"Met","Unmet")), "N/A")

Snip from my report. The line with a missing string corresponds to the 1st blank of the sequence.

Parents
  • Hello,

    The way you did this will not work for injections before the first injection of sample type 15. In this case there is no injection that meets this filter Where(function(y) y.Injection.Sample.Sample_OrderNumber<CurrentSample.Sample_OrderNumber). You may need to setup logic to find all injections before the first type 15 injection and then use a different CC for those. 

    Marty Adams

Reply
  • Hello,

    The way you did this will not work for injections before the first injection of sample type 15. In this case there is no injection that meets this filter Where(function(y) y.Injection.Sample.Sample_OrderNumber<CurrentSample.Sample_OrderNumber). You may need to setup logic to find all injections before the first type 15 injection and then use a different CC for those. 

    Marty Adams

Children
Was this helpful?