Data transformation

How to fill sale_price only for discounted products

2026-06-20
Task

A marketplace feed should contain sale_price only when the discount is greater than 0.

Short answer

Clear the output field first, then use a rule that checks discount and inserts discount_price only for discounted products.

How to do it in Eofferix

  1. Create sale_price from discount_price.
    sale_price filled only for discounted products
    The output table keeps the sale price empty for a product without discount.
  2. Use the first rule to clear the default value.
    Rules for conditional sale_price filling
    The rule checks discount and inserts the discounted price only when it is greater than zero.
  3. Use the second rule to check discount: if it is greater than 0, insert {discount_price}.
  4. Check products without a discount: sale_price should remain empty.

Before / after

The data below is a training example and does not belong to real user files.

Before

source data
skupricediscountdiscount_price
SKU-10011200101080
SKU-10029000900

After

result
skupricesale_price
SKU-100112001080
SKU-1002900

Process data faster with Eofferix

Create a free account to automate catalogs and price lists around your own rules.

Sign up