Trying to force a missing result in an Enum custom field

Options
So I have a custom field called Impurity_Amount and its a simple one of Area/CCalRef1[Area]*100 and this is not set for missing peaks, just the default Sample type All Peak Type All. I want to set up a Peak, Enum CF which will evaluate the result from Impurity_Amount and I want to return a translation for when a peak isn't detected but I think, because Impurity_Amount isn't active for missing peaks, it wont return anything. I have tried as the first argument in the ENUM formula:

EQ(REPLACE(Amount_Impurity,0),0) and a translation of Not Detected but it doesn't return anything. I have tried EQ(Peak Type,"Missing"). Again, nothing. I have even tried to make a Peak, Real CF from it along the lines of EQ(Peak Type,"Missing")*-1*60002 and still nothing. The ONLY way I could get the above two translations to return Not Detected was when I went back to the source custom field and added (formula)+0 and ticked the missing peak box for Amount_Impurity. Then the Bool translations returned what I wanted. 

But does that mean that any possible value from a CF also has to apply for missing peaks in order for related ENUM Cfs to return a Not Detected (or whatever) for missing peaks? Seems a very awkward way to so this as you are constantly making the source CFs "missing peak friendly". You don't need to do it for something like EQ(REPLACE(Amount,0),0) so why do you need to do it for custom fields? 

Answers

  • MJS
    Options
    Going to the first goal of a Peak/Enum CF without changing the original Impurity_Amount field...have you tried reversing this a bit from what you described?  Maybe an ENUM field (with the "use as" being "field") that translates to Not Detected where the peak label is "Missing" and translates to the Impurity_Amount (fc) when anything else (probably just a BOOL field to simplify the "anything else")?  Even then, you have to make this Peak/Enum field with the "missing" active, but it won't impact your original field which is what it seems like you are trying to avoid.

    My notes on custom fields states that the peak type specifications where you state "all" specifically excludes missing peaks which is where the checkbox then re-instates them.  So, it would seem that there is no other way around it if you want to make fields "missing peak friendly" in all cases...they all need the box checked.

    Alternately, could this be one of those cases otherwise where it's that the names of the custom fields are causing the issue...if the "Impurity_Amount" was alphabetically after your ENUM field, would it recognize the "Impurity_Amount" field yet?  I thought that there was a thread about that recently.
  • Hi MJS, I tried doing it as you suggested with Peak Type Equals Missing for the first ENUM argument and I really thought this would work because you are only asking Empower to return a translation from whether a Peak Type is Found or Missing but to my surprise I got a blank for missing peaks, and I had set this ENUM cf to use as Field. The CFs are named in Alphabetical order so no issue there. I suspect that when you use as "Field", Empower does an initial scan as to what the custom field is and if that custom field isn't set up for Missing Peak then the first argument will crash out. 

    I tried then to tick the missing box in my Impurity_Amount cf and again trying an ENUM argument with the updated CF but it still wouldn't work. I suspected this would happen because even with just the missing box ticked, I still had no argument within the formula to activate the missing peak such as REPLACE(Area/CCalRef1[Area]*100),0) or even (Area/CCalRef1[Area]*100)+0.000 so clearly when it comes to use as field, the "field" must be one where you account for a missing peak somehow, because as you say, a peak type of All does exclude Missing Peak. Yet when your use as field is a built-in field such as Area, Amount or Retention Time for example, you can force the missing peak in the first argument on the ENUM such as ENUM(EQ(REPLACE(Amount,0),0)…

    Unless im missing something here with this, pardon the pun, is there any way at all to force a custom field to return a Not Detected for missing peaks without having to make the original custom field to include missing peaks? It doesn't look like it though!