How to find nodes with a scalar predicate having values found during traversal

@MichelDiz Thanks. Your suggestion helped me. Hopefully I am on right track now.