[938] Conditional logic for filters

Fixes longstanding Issue #938, replacing Pull Request #1452 which was never merged.