Displaying Peak Type within a Bool/Enumerated custom field
I have a custom field that calculates % Impurity. My reporting limit is 0.5%. I'm trying to set up a custom field which, for values lower than this, displays "Below Reporting Limit" and for values equal to or greater than 0.5% displays the actual custom field results. That's fine I have that set up as follows: Peak Bool Calculated Use as Field and the formula is: GTE(Percent_Impurity,CConst7) with the translation table reading 0 = Below Reporting Limit and 1 = Percent_Impurity (fc).
The problem is I want to also display a "Not Detected" for peaks which are "Missing" so I tag on a "+EQ(Peak Type,"Missing")*-1*60002 at the end of the formula but when I process data it still shows blank for missing peaks, and I have the Missing checkbox ticked so that's not the issue. I tried an ENUM formula where one of the Bool conditions is "EQ(Peak Type, "Missing") with a corresponding translation in the translation table of -1*60002 (fc) but still nothing for missing peaks.
Is this because the data type is a field and you cant have two (fc) entries in the one table or is there another reason why I cant get this formula to display Not Detected for missing peaks?
Best Answer
-
Yes, you can do what you are asking in the second half of your post. That was actually how I built my impurity analysis.
Test to see if a peak is known or not, above the limit or not ... then do more math on the 0 and 1 operators returned by those two Boolean fields. This created a very easy metric to drop anything that returned a zero for further calculations (as 0 * anything = 0).
As for your first topic... there are two major concerns that I have. First, when custom fields become too cumbersome for Empower the process simply bombs out without generating results. Second, Empower really has a hard time with nested functions (fc). Such a hard time in-fact that I almost never use them.
I can see either one, two, or both happening to you. Another point to consider is that ENUM lists are "read" from left to right, the same way humans do. Empower will stop at the first true case in an Enumerated list. If your first element in the ENUM list is true for everything and it's set to -50,000, then there is the reason for your blank cell.
0
Answers
-
Make sure you have the "all or nothing" option checked for the custom field in question. Database translations do not happen unless this box is checked.
0 -
Hi. Yes, I have that ticked. Maybe the use as Field is the reason and it only displays one field in an enumerated list.0
-
It would seem that you are mixing too many things together, for lack of a better way to summarize your issue. A boolean field can only return a true or false, which is where you get a 0 or 1 in the translation table. You can't add more stuff to the formula and have a third option which is why that didn't work.
The enumerated list would be functional, but you need each condition set up correctly. You seemed to put a mathematical formula with the (fc) at the end, but that is not going to execute the formula unless you actually have a custom field you named "-1*60002."
I think what you want is an Field Type, ENUM data type, Calculated data source, Use as Field with the Missing Peak checked with the following formula:
ENUM(EQ(Peak Type, "Missing"), LT(Percent_Impurity,CConst7), GTE(Percent_Impurity,CConst7))
Your translation table would then be:
0=Not Detected
1=Below Reporting Limit
2=Percent_Impurity (fc)
So, the ENUM list has 3 conditions and you would have 3 items in the translation table. The peaks should fit one of these buckets (missing, LT, or GTE) and while there may technically be overlap that both condition 1 (missing) and 2 (LT) are both true, Empower should hit true on condition 1, stop, and report the translation. It should not proceed to then identify more than one true condition, so the order is therefore important from left to right.
0 -
personally, I would accomplish by using math: EQ(Peak Type,"Missing")*-1*60002 + LT(Area %, 0.5)*-1*60008 + GTE(Area %, 0.5)*1*Area %.
The general problem with the above approach, is that you are not recalculating area percent as peaks drop off your list. For example, say you have 10 impurities at 0.49% each and nothing else in your chromatograms.
You will report out a purity on your active of 95.1% yet you don't have any reportable impurities...
0 -
Hi, thanks for the replies but I am looking for more help on this one. I tried making the Peak, Enum CF as suggested by MJS but it still wont display anything for missing peaks. My sample and peak type are set to all, I have the missing peak ticked (but not the all or nothing) and use as set to field. My translations are 0 = Not Detected 1 = Below Report Limit and 2 = Percent_Imp (fc) but It wont return a result for any of the Boolean conditions, either a peak type of missing, a peak with a Percent_Imp of less than CConst7 or greater than or equal to CConst7. Just blank fields. Is it related to setting precision for output for Percent_Imp? I set that to max of 14 so I don't know. I have another ENUM cf similar to this which works perfect and has only two Bool conditions (Less than CConst7 and greater than or equal to CConst7 and this works fine, its written as ENUM(LT(Replace(Percent_Imp,0),CConst7),GTE(REPLACE(Percent_Imp,0),CConst7)) with use as Field as translation 0 = Below Limit of Detection and translation 1 = Percent_Imp (fc). Maybe a peak type of missing cant be included in an enum list for some reason?
I tried MJS method briefly earlier by writing a cf along the lines of EQ(Peak Type,"Missing")*-1*60002 and activated all or nothing and this works fine but can this include custom fields eg will a formula of the type EQ(Peak Type"Missing")*-1*60002+LT(Percent_Imp,CConst7)*0+GTE(Percent_Imp,CConst7)*Percent_Imp work? Can you multiply a Boolean by a custom field as in "GTE(Percent_Imp,CConst7)*Percent_Imp" or can this only be activated as the use as field?
0 -
Thanks Shanuwat, maybe this is just too complicated for Empower as you said, nested functions can be a strain and I do have a lot of peaks so that multiplies the issue. I might just keep it simple with a Boolean function like GTE(Percent_Imp, 0.10) and Use as Field for a result or a Below Reporting Limit.0