Enum Custom Field - Translation

Hi all,
Is it possible to create a Peak, Enum CF with a formula for the translation?
I want to perform different calculations for different peaks.

I tried the following:
ENUM(EQ(Name,"Impurity 1"),EQ(Name,"Impurity 2"),EQ(Name,"Impurity 3"))

Translation:
0 = Height*100/API[Height]
1 = (Height-Matrix 1[Height])*100/API[Height]
2 = (Height-Matrix 2[Height])*100/API[Height]

At the moment Emopwer only shows the formula as a text in the custom field.

Thanks in advance!


Answers

  • Empower2019
    edited November 2019
    I think it is but you have to set the Use As section of the custom field to "Field" and not Text, Value or Position. When I have to use a peak, enum with Use as Field I usually have a few options like 0- Below Detection Limit 1- Below Reporting Limit and the 3rd translation is a custom field like Percent_Imp but crucially you must put a space after the custom field then (fc) which stands for field code. This tells Empower to look for a field called Percent_Imp and not just to return the text "Percent_Imp" for any positive arguments in translation 3. 

    Ive never used all translations as formulas, but it might work if you change the Use as to Field and either put (fc) after all the formulas or leave it out and Empower will automatically recognize what you are trying to do. 

    Another way to achieve this is use a conditional Bool in a Peak, Real, Calculated custom field:

    (EQ(Name,"Impurity1"))*(Height*100/API[Height])+(EQ(Name,"Impurity2"))* ((Height-Matrix 1[Height])*100/API[Height])+(EQ(Name,"Impurity3"))*((Height-Matrix 2[Height])*100/API[Height]) and if you need to substitute instead of API, use CCalRef1 instead and populate the CCalRef1 field of your processing method with your API peak. 
  • medicnman
    edited November 2019
    When it can be applied, I find this approach much more valuable as well....

    Another way to achieve this is use a conditional Bool in a Peak, Real, Calculated custom field:
    (EQ(Name,"Impurity1"))*(Height*100/API[Height])+(EQ(Name,"Impurity2"))* ((Height-Matrix 1[Height])*100/API[Height])+(EQ(Name,"Impurity3"))*((Height-Matrix 2[Height])*100/API[Height]) and if you need to substitute instead of API, use CCalRef1 instead and populate the CCalRef1 field of your processing method with your API peak
  • Hey,

    Thanks for the feedback. It`s a great idea to create a conditional Bool in the custom field.
    It`s much easier than a Enum CF  :)

    Thanks a lot!