We should be able to filter with a
WHERE x AND y
OR
WHERE a AND b
but currently after the first where we cannot include multiple double filters.
For example I want to filter one metafield against two others.
We should be able to filter with a
WHERE x AND y
OR
WHERE a AND b
but currently after the first where we cannot include multiple double filters.
For example I want to filter one metafield against two others.
Was able to find the answer with support. Use the common filter as the AND clause, so:
WHERE X AND Y
OR Z AND Y
as opposed to what I was previously trying which was (parenthesis did not change anything either):
WHERE Y AND X
OR Y AND Z
reply from a shopify partner confirming: The reason that worked is that Shopify’s filter parser doesn’t support algebraic factoring like Y AND (X OR Z). Since parentheses get completely ignored, writing WHERE Y AND X OR Y AND Z causes the parser to evaluate Y first, which breaks the logic before it even gets a chance to evaluate Z.
By rewriting it as WHERE X AND Y OR Z AND Y, you’re forcing the parser to evaluate each complete pair (X AND Y) and (Z AND Y) separately across the OR boundary.