Tricky custom field required

Hello, I run blocks of samples, 10 per block, and there could be 6 blocks one day and 20 the next. 

I need to correct each Amount of the 10 samples by multiplying it by a correction factor for each sample in the block which is fine and I have a working custom field for that, Corrected_Amount

Then I need to add up the last 2 values for Corrected_Amount for samples 9 and 10 of the block and again thats fine I have a custom field for that too- Summed_Amount (U9.%.(Corrected_Amount+U10.%.(Corrected_Amount)

The tricky part is I need to divide each Corrected_Amount from samples 1-10 by the Summed_Amount for each block and the problem is the value for Summed_Amount doesnt appear until samples 9 and 10, as thats the only samples Empower has an instruction to calculate, so there is a blank cell for Summed_Amount for samples 1-8. Is there any way I can use a summary field such as SAME.%..MAX(Summed_Amount) which would then appear in all samples 1-10 and therefore allow me to divide all Corrected_Amounts by the Summed_Amount value for each block?? Thanks in advance. 

Comments

  • Hey Empower2019,

    I tried your custom field (with one block of 10 samples) as i do not have more.
    And I get for all my injections a value for the Summed_Amount peak.

    Peak, Real (0.0), calculated, Result set only, All or Nothing Ticked, Unknowns Only, with calculation 
    (U9.%.(Amount_CConst1)+U10.%.(Amount_CConst1))

    So might it be that empower gets conflict because you have more sample Blocks?
    I suggest try doing only one block and see if that gives a value for all your sample injections?


  • Empower2019
    edited December 4
    Hi Jovvor, thanks for the reply. 

    Im surprised you are getting a value for Summed_Amount for all the injections given that you have all or nothing ticked which normally would only display the correct value at U10, ie a place where all conditions are present. I was getting a value for Summed_Amount for injections U1 to U8 but it was the wrong value. The correct value only displayed at U9. 

    In the end I got it to work by specifying the label and field that I wanted divided by Summed_Amount, so:

    U1.%.(Corrected_Amount)/U9.%.(Summed_Amount), and U2.%.(Corrected_Amount)/U9.%.(Summed_Amount) and so on, I needed 9 new CFs in the end to achieve this and the beauty of it was it will work on as many blocks of 10 samples as you need, as the custom field rule which states that Empower always used the most recent result in a result set which links the U1 to U8 to the following U9 result and then the next set of U1 to U8 to the following U9 and so on. The only limitation to this is the correct values would only display at label U9 so I had to be a bit creative in the way I reported them as I only had the correct value for one sample. 

    I tried a few different ways to achieve this in order to reduce the number of CFs I needed but I couldnt see a way around creating so many of them. 
  • the All or Nothing tick box was so i had the correct value at U9. Else U9 only displayed the U9 value as if U10 was zero.

    Yes, creating 10 different custom fields also work. I have something similar created where every label is specified for 10 different standard calculations cause it could not be done by a simple approach.

    I am starting to think that it might have to do with your first custom field (Corrected_Amount).
    It is strange that i get the correct result for my sample set and you do not...

    Or it might have to do something with the naming and the order Empower uses them.. Just speculating ofcourse
  • Do you use summarize custom field at the end even of your sequence even if it is not a summarize function custom field?

    We standard do this at every sample set. Might it have to do something with that?
  • Hi Jovvor I never tried that actually and I recall from past training slides that if you have summarise custom fields at the end of the sample set then Empower will display the results of a non summary custom field in all rows and for all samples and not just the U9 sample where all conditions are present. If it works them the summed_amount CF will be calculated at U9 and then when Empower encounters the SCF function it will run through the sample set again line by line and then display the correct summed_amount for U1 to U8 also and in each block too.

    I'm away from my computer today but I'm going to try this when I log on again. If it does work then I can combine 9 CFs in one by a peak real CF with formula EQ(Label "U1")*Corrected_Amount/Summed_Amount+EQ(Label,"U2")*Corrected_Amount/Summed_Amount...and so on up to U9.

    Thanks for the suggestion!
  • That didnt actually work, even when Summarize Custom Fields was added to the sample set. The correct answer only displayed on the U9 sample for each block and every other U1 to U8 had an incorrect answer probably from only having half of the calculation present. The stumbling block is I need that addition of U8/U9 and then Im asking Empower to go back to U1 to U7 and divide each value by this summed U8/U9 and the value isnt calculated until U9 is processed. Multiple CFs are the only way I see around this. 
  • That is sad. I would think it should work one way or another.
    Maybe something to ask Neil Lander in one of his tip of the week posts :)