I have a Math Formula node in Knime 3.5.3 which is not always outputting a value for every record. The expression in the node is below, and uses an if(x,y,z) function to check two Boolean field values before comparing some Double values, then outputting a true or false condition value.
if($Has_Actual$ && $Has_Prediction$ &&
($Count*(Investment)$>2 &&
abs($Investment$-$Predicted_Investment$)>2*$Standard deviation(Investment)$)
|| ($Count*(Investment)$<=2 &&
abs($Investment$-$Predicted_Investment$)>.2*abs($Investment$)+10),
1,
0)
But in the node output, only rows that have “true” values for the two Boolean fields ($Has_Actual$ and $Has_Prediction$) are getting values output. My expectation is that the if(x,y,z) function should have an output for every row. Since a “false” value for either one of my Boolean fields will result in the test condition not being true, I am expecting the output to be the false condition value (0 in my expression).
Note, if $Has_Actual$ is false, then $Investment$ is missing, and $Count*(Investment)$ and $Standard deviation(Investment)$ might be missing. If $Has_Prediction$ is false, then $Predicted_Investment$ is missing. Perhaps the Math formula is not short-circuiting on each && clause and tries to process the later expressions, which would cause NaN or nullpointer exceptions?
Why might this function not be outputting values?