One can't really use logic in this fashion when setting up a pipeline. Remember that this is just the pipeline definition which only get's executed once (when the algo is initialized) and NOT really code which get's executed when fetching data.
The most foolproof method is to simply do this logic when the dataframe is returned (typically in the 'before_trading_start' method).
However, there are a few neat methods that factors have which could be useful in this specific case. Take a look at this post https://www.quantopian.com/posts/log-normal-return-built-in-factor . The 'abs()' method may do what you want? Something like this.
ev = Fundamentals.enterprise_value.latest
ebitda = Fundamentals.ebitda.latest
testingFactor = ebitda / ev.abs()
Not sure if this works for you but check out the attached notebook.
Good luck.