Data transformation

How to calculate discount percent from old and new price

2026-06-20
Task

The file has old_price and price. The export needs discount_percent for a storefront or marketplace.

Short answer

Create a column from old_price, subtract the current price, divide by old_price, multiply by 100, then round.

How to do it in Eofferix

  1. Create discount_percent from old_price.
    Discount percent calculated from old and new price
    The output column shows the discount percent for each product.
  2. Add a math subtraction rule with {price}.
    Math rule chain for discount percent
    The calculation follows (old_price - price) / old_price * 100.
  3. Divide the result by {old_price} and multiply by 100.
  4. Round the value to the required precision.

Before / after

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

Before

source data
skuold_priceprice
SKU-10011200900
SKU-10021000850

After

result
skudiscount_percent
SKU-100125
SKU-100215

Process data faster with Eofferix

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

Sign up