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.
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.
0
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?
0 -
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.0 -
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
0 -
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?0 -
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!0