I may be misunderstanding your requirement but it looks to me that you need some sort of aggregation in your expression (sum, avg, max etc) otherwise you will return null and the comparison will fail hence only one value is returned.

I'm not sure why you are using the variable, but doesn't this work ...