Skip to main content

Advanced Filtering

The basics of the filter builder — picking a field, an operator, and a value, and joining conditions with AND/OR — are covered in Setting up filters. This page focuses on the techniques you'll reach for less often but that unlock a lot of power once you know they exist.

Cross-field comparisons

Most number conditions compare a field to a constant ("Price is greater than 50"). For Price, the builder also lets you compare against another numeric variant field — without typing the number yourself.

You can compare Price against either:

  • Compare-at price — less than / equal to / greater than, plus percentage variants ("less than X% of Compare-at price").
  • Cost — same set of operators.
Cross-field comparison: Price is less than 110% of Cost

Cross-field comparisons let you target margin or discount thresholds without static numbers.

Use cases:

  • Find variants with thin margins: Price is less than 110% of Cost.
  • Find variants where a sale was never actually a discount: Price is greater than or equal to Compare-at price.
  • Audit promo health: Price is greater than 80% of Compare-at price to flag "fake" discounts.

These conditions adapt per variant — the threshold is calculated against each row's own values, not a global number.

Metafield filters

Match against any metafield on the product or variant. Pick:

  1. The scope — product or variant.
  2. The namespace and key (free text — type the exact namespace and key you defined in Shopify admin).
  3. The value type — string, number, or boolean. The operators in the next dropdown change to match.

For string metafields you get the same operators as any text field (contains, equals, starts with, is blank, is defined, has duplicates, …). For number metafields you get numeric operators (=, >, between, …). For boolean metafields you pick true or false.

Metafield condition with namespace, key, value type, and operator

Metafields use namespace + key + value type. The operator set adapts to the type.

Use cases:

  • Find products missing a required custom field: Metafield "custom.material" is not defined.
  • Filter by a sustainability flag: Metafield "specs.eco_certified" equals true.
  • Catch typos in a structured metafield: Metafield "specs.color" has duplicates.

Inventory at a specific location

The regular Inventory condition matches against total stock across all locations. Inventory at location lets you filter by stock at one specific location instead.

Pick the location from a dropdown (populated from your Shopify locations), then use any numeric operator — equals, greater than, between, etc.

Use cases:

  • Replenishment at a single warehouse: Inventory at "Brooklyn DC" is less than 10.
  • Audit a pop-up store before closing: Inventory at "SF Pop-Up" is greater than 0.
  • Move stock to wholesale: Inventory at "Main DC" is greater than 100 and Inventory at "Wholesale DC" equals 0.

Collection membership

The Collections condition matches by collection rather than by manual product picking. Five modes:

  • In any of — Match if the product is in at least one of the selected collections.
  • In all of — Match only if the product is in every selected collection.
  • Not in any of — Exclude products that are in any of the selected collections.
  • Not in any collection at all — Find orphan products with no collection.
  • Not in any manual collection — Like above, but only counts manual (non-smart) collections.

The last two modes don't take collection IDs — they're cross-cutting "anything that isn't in any collection" filters, great for finding products that slipped through your merchandising workflow.

Combining conditions effectively

Some patterns worth knowing:

Layering exclusions

Use AND with negative conditions to whittle down a wide filter:

  • Status equals Active
  • AND Tags has none of "do-not-edit"
  • AND Specific products (Exclude on) — 5 products

Mixing OR groups inside ALL

The builder doesn't expose nested groups (no (A OR B) AND (C OR D)), but you can usually achieve the same intent by running two jobs back to back, or by using Has any of operators that already represent an OR over values:

  • Tags has any of "summer", "spring" is OR within the tags condition.
  • Collections in any of "Sale", "Clearance" is OR within the collections condition.

When to filter at variant scope

If your modification is variant-level (price, SKU, weight, inventory) and you want to target only some variants of a product, build the filter with variant-level conditions:

  • Variant SKU starts with "OLD-"
  • Variant inventory equals 0
  • Cost is greater than 50

The results table will show one row per matching variant rather than per product.

Worked examples

Low-margin variants on active products

  • Match ALL
  • Status equals Active
  • Price is less than 130% of Cost

Use this monthly to flag pricing that needs review.

Discount cleanup

  • Match ALL
  • Compare-at price is defined
  • Compare-at price is less than or equal to Price

These variants are showing a strikethrough that isn't actually a discount. Pair with a Compare-at price modification set to Clear.

Missing structured data

  • Match ALL
  • Metafield "specs.material" is not defined
  • Product type equals "Apparel"

Find apparel products missing the material metafield before pushing them to a feed.

Hand-picked exceptions to a vendor update

  • Match ALL
  • Vendor equals "Acme Co"
  • Status equals Active
  • Specific products (Exclude on) — pick the 3 SKUs already on promo

Stock rebalancing at one warehouse

  • Match ALL
  • Inventory at "Brooklyn DC" is greater than 50
  • Inventory at "Manhattan Store" is less than 5
  • Status equals Active

Pair with an export to send the list to the warehouse team.

What's next?