Table transformations

How to create group_id from product variant SKU

2026-06-20
Task

Product variants use SKUs such as TSHIRT-100-RED-M and TSHIRT-100-BLUE-L. A marketplace feed needs one shared group_id without color and size.

Short answer

Create group_id from sku and keep only the prefix before the second dash with ^[^-]+-[0-9]+.

How to do it in Eofferix

  1. Open the settings of the output group_id column and select sku as the source.

    group_id column settings in Eofferix
    The outline marks the group_id column.
  2. Add a transformation: condition Regular expression, value ^[^-]+-[0-9]+, action Remove everything except.

    Rule for creating group_id from sku
    The regular expression keeps the shared part of the variant SKU.
  3. Save the template and run the transformation on the final step.

Before / after

Before

source data
skuname
TSHIRT-100-RED-MRed T-shirt M
TSHIRT-100-BLUE-LBlue T-shirt L

After

result
skugroup_id
TSHIRT-100-RED-MTSHIRT-100
TSHIRT-100-BLUE-LTSHIRT-100

Process data faster with Eofferix

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

Sign up