Averaging 2 rows

When we are running samples, we always run 2 samples of each and have a strict naming convention where they are always named "SAMPLENAME-A" and "SAMPLENAME-B".  Is there a way to have the average of selected values in "-A" and "-B" be displayed?  We often run 10 or more samples, each with "-A" and "-B" versions.  

I use Custom Calculator values for many of the values.

 

I am not worried about how the values are displayed.  I would prefer that they are displayed inline after each sample pair (as displayed on the image), but they can also be displayed after the total sample run in it's own table.

 

CURRENTLY:

 

DESIRED DISPLAY:

 

While I am a programmer comfortable with PHP, I am not well versed with VB, and not sure how to work within the confines of the console.

Parents
  • Hello,

     

    You can use a CCF to do the calculation. I would start by splitting up the name as shown below in SampleNameT. Then you can use that separated name to group your injections both in CC and IR. Then you can use an expression like PeakAve, to get the average by compound across the duplicate injections where the name before the - matches. You can replace compound amount with compound concentration or any other peak variable in that expression.  You can also replace it with something like GetDoubleCC("CC20") where the name in "" is another peakorgroup CC.

     

    CStr(Split(Sample_Name, "-")(0))

     

     CurrentSequence.AllPeaksAndGroups.Where(function (x) x.Injection.Sample.Sample_Type = 3) .Where(function (x) x.Injection.GetStringCC("SampleNameT") = CurrentInjection.GetStringCC("SampleNameT")).Where(function (x) x.Compound_Name = CurrentPeakOrGroup.Compound_Name).Select(function(x) x.Compound_Amount).Average

     

     

     

     

  • Martin,

    Sorry for the VERY late response, but I finally got time to look into this.  Thank you very much for your guidance, and your answer works perfectly to show the average when I am in Data Analysis on the Data Processing page and the Injection Results (Peaks) window.  I am having a hard time trying to get this value to display in a report (as shown on first screenshot I posted on the original post).  I am trying to get it to display in a new column of a table repeated on Sample_Name. 

    I tried using this:  =CFE((Sample_CustomFields),"PeakAve")

    No luck with that.  Can you give me a little guidance on how to get that to display?

    Maybe I need to do more with a CCF?  Maybe the current CCF needs to be a scope other than "Peak or group"?  Hmmm ...

Reply
  • Martin,

    Sorry for the VERY late response, but I finally got time to look into this.  Thank you very much for your guidance, and your answer works perfectly to show the average when I am in Data Analysis on the Data Processing page and the Injection Results (Peaks) window.  I am having a hard time trying to get this value to display in a report (as shown on first screenshot I posted on the original post).  I am trying to get it to display in a new column of a table repeated on Sample_Name. 

    I tried using this:  =CFE((Sample_CustomFields),"PeakAve")

    No luck with that.  Can you give me a little guidance on how to get that to display?

    Maybe I need to do more with a CCF?  Maybe the current CCF needs to be a scope other than "Peak or group"?  Hmmm ...

Children
Was this helpful?