Custom Field that calculates the avg of 2 injections and updates as injections are made

I have a sample set like
Blnk 1A
Blnk 1B
Smpl 1
Smpl 2
Blnk 2A
Blnk 2B
Smpl 3
Smpl 4

I need to subtract the average Amount of Blnk 1A and Blnk 1B from Smpl 1 and Smpl 2 and then subtract the average Amount of Blnk 2A and Blnk 2B from Smpl 3 and Smpl 4. Is it possible to create just one CF that calculates the average Amount  of Blnk 1A and Blnk 1B and then updates to the average Amount  of Blnk 2A and Blnk 2B when those injections are made. Also, because of other CF's the Labels for Smpl 1 and Smpl 3 must be U1 and the Labels for Smpl 2 and Smpl 4 must be U2.

Answers

  • For the average amounts of the 2 sets of blanks I would first label the Blank 1A/1B as BLANK1 in your Label column and for Blank 2A/2B BLANK2. Then create a peak, real CF result set only search order with formula SAME.%..AVE(Amount) and call it Blank_Amount_Avr. This will give 2 sets of results in your result set- an average amount for each set of blanks using SAME to recognize they are the same label. 

    Then for your samples you can create another peak, real CF result set only with formula:

    Amount-Blank_Amount_Avr*EQ(Sample Type,"Sample")

    Add Summarize Custom Fields to your last line of sample set, process a sample set and the results should generate in your result set. Empower should be able to recall the most recent value of Blank_Amount_Avr and subtract that figure from the samples so the U1 etc shoudnt have any impact. Just make sure to set peak and sample type to All for these custom fields. 
  • Thank you for your help. Blank_Amount_Avr is being calculated correctly for the BLANK injections. However, it's being updated for the sample injections which is not what I want. Is there anyway to keep Blank_Amount_Avr equal to the Average amount of Blnk 1A and 1B for the sample injections?

    INJECTION  LABEL       Blank_Amount_Avr Value
    Blnk 1A      BLANK1    Average amount of Blnk 1A and 1B. 
    Blnk 1B      BLANK1    Average amount of Blnk 1A and 1B. 
    Smpl 1       U1            Avg amount of all U1 injections. Want this to be the Avg amount of Blnk 1A and 1B. 
    Smpl 2       U2            Avg amount of all U2 injections. Want this to be the Avg amount of Blnk 1A and 1B
    Blnk 2A      BLANK2    Average amount of Blnk 2A and 2B. 
    Blnk 2B      BLANK2    Average amount of Blnk 2A and 2B.
    Smpl 3       U1            Avg amount of all U1 injections. Want this to be the Avg amount of Blnk 2A and 2B
    Smpl 4       U2            Avg amount of all U2 injections. Want this to be the Avg amount of Blnk 2A and 2B
  • Thanks for clarifying that. If you make a separate CF for each set of blanks, so Label Blank 1A/1B as BLANK1 and label Blank 2A/2B as BLANK2, then create 2 sets of CFs peak, real, calculated search order result set only, peak and sample type of All:
    BLANK1.%..AVE(Amount) and BLANK2.%..AVE(Amount): Blank_One_Average and Blank_Two_Average

    Then your sample CFs become:

    Amount-Blank_One_Average
    Amount-Blank_Two_Average


    I would call these two CFs with a name higher than B i.e. Blank_One_Average starts with B and custom fields are calculated in alphabetical order so your 2 sample CFs should be called something like Sample_One and Sample_Two to allow for Blank_One_Average and Blank_Two_Average to be calculated. 


  • I was really hoping to do this with just one CF that would update as the Sample Set progressed but I don't think that's possible. I appreciate your help and I did learn a few things from your posts.