Problems with dynamic filtering of DB query - "Value is not set for parameter x"

Look into short circuit filtering
How to run Script faster - Ignition - Inductive Automation Forum