I suggest breaking this down into parts and checking to see if each part evaluates as expected. Since you have advanced, you might start by entering this expression as a Watch expression. True results will evaluate as 1. False results will evaluate to 0. You can then test different portions of the expression in the data viewer to narrow things down to just the part that is not evaluating correctly.