Hi!
I’m assuming your starting point was this post and you are using checkboxes for your filters.
The issue is that you are putting ORs where they shouldn’t be. Example:
(c2 && Item.Price > 10) || (c2 && Item.Price < 20)
This says:
“checkbox c2 is selected and price is greater than 10 OR checkbox c2 is selected and price is less than 20”
Because of the OR between the two expressions, either of these things can be true, so this expression will be true for any price whatsoever when c2 is checked, because every price is either greater than 10 OR less than 20.
For example, 100 is greater than 10 OR less than 20 because only one of these two tests needs to be true, and >10 is true for 100. Same applies to -100, as <20 is true for -100.
You need to replace this expression and the ones like it with this:
(c2 && Item.Price >= 10 && Item.Price < 20)
Which can be written more verbosely as
(c2 == true && Item.Price >= 10 && Item.Price < 20)
Which means:
checkbox c2 is checked AND price is greater than/equal to 10 AND price is less than 20.
The whole filter should look like this:
[[ (!c1 && !c2 && !c3 && !c4 && !c5) || (c1 && Item.Price < 10) || (c2 && Item.Price >= 10 && Item.Price < 20) || (c3 && Item.Price >= 20 && Item.Price < 30 ) || (c4 && Item.Price >= 30 && Item.Price < 50) || (c5 && Item.Price >= 50) ]]
Sample: morefilters.rp (62.1 KB)