Page 1 of 1

Empower 3 Pro Custom Field processing

Posted: Fri Dec 28, 2018 4:15 pm
by bry_fieri
I am trying to perform a custom calculation in empower using the sample area of a peak and the standard area of the same peak.

For example: (U%..(CCompRef1[Area])/(S%..(CCompRef1[Area]-U%..(CCompRef1[Area]))

However I have multiple samples and standards that are compared (U1 to S1, U2 to S2, and so on) and I'm trying to make a universal calculation instead of writing out the calc for each label group.
I have tried to use the summarize custom fields (plain and incrementally) using the labels however unlike calibrate i can't type both labels into the label reference it only allows for one and no wildcards. Any help on getting this to work for multiple samples would be greatly appreciated.

PS
I have gone through several iterations of this calc in my attempts:

By label:
(U1..(CCompRef1[Area])/(S1..(CCompRef1[Area]-U1..(CCompRef1[Area]))

Wildcard %:
(U%..(CCompRef1[Area])/(S%..(CCompRef1[Area]-U%..(CCompRef1[Area]))

Wildcard ?:
(U?..(CCompRef1[Area])/(S?..(CCompRef1[Area]-U?..(CCompRef1[Area]))

No Sample label:
(CCompRef1[Area]/(S%..(CCompRef1[Area]-(CCompRef1[Area]))

and my sequence is and must remain as:

Blank
S1
S2
S3
Blank
U1
U2
U3

Again thank you

Re: Empower 3 Pro Custom Field processing

Posted: Fri Dec 28, 2018 8:17 pm
by EmpowersBane
Ok, so first of all don't worry about how Summarize Custom Fields works because you don't need it for this problem. This only applies when you use summary functions like AVE,MAX etc in your formulas. You aren't doing this so leave it out of the sample set.

Rather than coding many different formulas, use a Boolean formula against each condition and when its satisfied, ie when it returns a "1", multiply it by your formula, that way you can create several different conditions within the one custom field. Keep the labels exactly as you have in your OP. Create a Peak, Real, Calculated custom field. Set search order to Result Set Only or Result Set First, preferably Result Set Only to keep all results within the same result set. Its much cleaner to process sample sets to yield results sets for this custom field.


Set the Sample Type to All, since you are incorporating both standards and unknowns (or of course you could just set the sample type to Standards and Unknowns to speed up the calculation a bit). Set the Peak Type to Founds Only, again to speed it up a bit. You dont need to tick All or Nothing or Missing Peak, i presume you dont want to include Missing Peaks. Set your width and precision as desired, default values are usually fine.


Now, as for your formula, you need to type this EXACTLY as outlined, I advise typing it in a Word document then copying and pasting it into the Formula entry box of the custom field editor when you are happy with it. You dont really have extra brackets in your original formula and i have learned the hard way this can screw up the calculation completely, plus you dont reference the injection, so im throwing in a % for that. If you leave out injection, but include label, Empower only throws back the previous result and ignores the current result- look up rules of intersample custom fields in Empower help for more info on this. You also have no safety net in place for instances where S1.%.(CCompRef1[Area]-U1.%.(CCompRef1[Area]) yields a negative value (example 145-156)so throwing in the syntax ABS for absolute ensures the formula will treat a number like -234 as +234 for the sake of the formula. So here is your formula:

(EQ(Label,"S1")+EQ(Label,"U1"))*ABS(((U1.%.(CCompRef1[Area])))/((S1.%.(CCompRef1[Area])-U1.%.(CCompRef1[Area]))))+(EQ(Label,"S2")+EQ(Label,"U2"))*ABS(((U2.%.(CCompRef1[Area])))/((S2.%.(CCompRef1[Area])-U2.%.(CCompRef1[Area]))))+(EQ(Label,"S3")+EQ(Label,"U3"))*ABS(((U3.%.(CCompRef1[Area])))/((S3.%.(CCompRef1[Area])-U3.%.(CCompRef1[Area]))))

This formula is complex so will take an extra up to 5 minutes to complete when processing therefore dont examine the result set until processing has 100% finished, keep an eye on the processing server box until its flashing "Waiting". This formula will then display the results of U1(CCompRef1[Area])/(S1(CCompRef1[Area]-U1(CCompRef1[Area] at the lines where labels are S1 and U1, same for S2 and U2 etc. You can display the results in a table in a report method by having all the samples and standards included, ordered by Date Acquired, and the custom field should give a different result for each pair of labels. Good luck.