system for filtering either scalar values or arrays of values