Page 1 of 1

Empower & Custom fields

Posted: Tue Mar 28, 2006 10:03 am
by Syntaxerror
Hello !
I'm looking for someone who know the Empower custom field programmation language.
I would like to translate the match angle value (°) in match %. That's the reason why I create a custom field with the following formula :
100-(100xPDA Match angle/90)
The result is good but if no compound is found (PDA match angle is empty), the value is considered as equal to 0. So the Match % Calculated is equal to 100...
So how writing query in a custom field (if PDAmatch angle is not equal 0 then...)

I hope I would have been clear :oops:

Posted: Thu Mar 30, 2006 8:31 am
by bartjoosen
Take a look at the EQ function, and the REPLACE function.
There is a good help in Empower.

I can write the whole formula for you, but if you never had to think about it, you will never know how to set up.

Give it a try, and come back when you fail or in case of other troubles.

Good luck

Posted: Thu Mar 30, 2006 8:43 am
by Syntaxerror
ThanX. I will try, so. If I fail, I will give in.

Posted: Thu Mar 30, 2006 12:42 pm
by Syntaxerror
I tried this and it seems to work :D :
GT(PDA Match1Angle,0)*(100-(100*PDA Match1Angle/90) )
Explanation : the first part of the formula (blue) check if PDA Match1Angle value is Greater Than 0. If the Boolean value is true then the second part of the formula (Red) is multiplied by 1.
If no spectra is matched (PDA Match1Angle field is empty), the second part of the formula is multiplied by 0 and my custom field is so empty.

It works but I found it hard. if there is easier, I'm open.

:idea: Now harder :
I would like to translate Peak Code field Q9 & Q10 in "Out of Range".
If somebody has an idea...

Posted: Thu Mar 30, 2006 7:13 pm
by A.Nonymous
Don't think you can change the peak code values.
Another thing u can do is to make a custom field which contain the out of range value.
You can combine the value of the threshold and the out of range message in 1 custom field, which shows up as approved/out of range/....

For this you need to use the REPLACE function.

By the way: your formula is OK, it seems hard, but once you understand, you can play around with it.