Embedding Boolean Text Custom Field within ENUM

Options
B_Nova
edited February 7 in Software Products
Hey all, 
I'm working on some special reporting features for an impurity test. I want to be able to report calculated values greater than 0.05% as the calculated value, values between 0.01% and 0.05% as "<0.05", then for values less than 0.01% I want to report specified impurities as "ND" and unspecified impurities as "Do Not Report"

I set up an ENUM custom field that can manage the reportable values and <0.05 values, then made an additional boolean custom field "SpecifiedImpReporting" that will report "ND" or "Do Not Report" based on the component type. My problem is when I try to embed the boolean field "SpecifiedImpReporting (cf)" under translation it comes up blank.

To summarize I've made two custom fields:

1) A Boolean, EQ(Component Type,"Specified Impurity")

Value=0, Translation=Do Not Report
Value=1, Translation=ND

Use as=Text

2) An Enumerated, ENUM(LT(Imurity,0.01), RANGE(Impurity,0.01,0.05), GTE(Impurity,0.05))
  
Value=0, Translation=SpecifiedImpReporting (fc)
Value=1, Translation=<0.05
Value=2, Translation=Impurity (fc)

Use as=Field

Is this just not possible?

 

Answers

  • Empower2019
    edited February 7
    Options
    The way to do this is to incorporate the first CF into your ENUM CF and making the formula and list of options a bit longer. So your ENUM CF becomes:

    ENUM(LT(Impurity,0.01)&EQ(Component Type,"Specified Impurity"),LT(Impurity,0.01)&EQ(Component Type,"Unspecified Impurity"),RANGE(Impurity,0.01,0.05),GTE(Impurity,0.05)) and your 4 translations become 0: ND 1: Do Not Report 2: <0.05 and 3: Impurity (fc). 

    I tried this on some sample data and it worked fine. I am presuming that you have set the component type for your second translation to "Unspecified Impurity" in the processing method. If they are just unknown peaks LT 0.01 you can amend the formula to EQ(Peak Type,"Unknown") for that portion of the ENUM CF and it will work either way. 

    Another thing to note is that the function RANGE is defined within Empower as GT X,LTE Y. So your formula of RANGE(Impurity,0.01,0.05) is going to be interpreted as any values GREATER THAN 0.01 and less than or equal to 0.05, so this function will not capture any impurities of 0.01. To overcome this, you may want to amend this section of the formula to GTE(Impurity,0.01)&LT(Impurity,0.05). This will capture any values of 0.01 for Impurity. 
  • B_Nova
    Options
    Thank you so much, this worked beautifully.