Table transformations

How to Safely Convert 10+, >10, and Text Stock Values to Numbers

2026-06-20
Task

The source stock column mixes integers, values such as 10+ and >10, and text markers such as out of stock and preorder. The target column must contain a number only for explicitly supported formats.

Short answer

Map the exact text markers first, leave the final value blank for every unsupported format, keep the digits, and add 1 only when the original source value has the >N form.

How to Do It in Eofferix

  1. Add or open the target stock column and select stock_raw as its source. Both names are examples used only in this walkthrough.

  2. Add the first three rules: AnyTrim spaces at edges; Equals with out of stockReplace with0; Equals with preorderReplace with0.

    Six rules that validate and convert text stock values to numbers
    Exact markers are handled first, unsupported formats leave the final stock value empty, and a value greater than 10 becomes 11.
  3. Add a whole-value guard: Not a regular expression with ^(?:\d+\s*\+?|>\s*\d+)$Do not export field; then Regular expression with \d+Remove everything except; finally test the original source column with ^\s*>\s*\d+\s*$ and apply Add with 1.

  4. Apply the rules and inspect every supported and unsupported value in the preview. Then run a small test export and open the downloaded file. Continue only if an unknown phrase containing a number leaves the final value blank in both the preview and the file.

Important. stock_raw, stock, out of stock, and preorder are examples. Use the actual column names and exact supplier codes in your data. The preorder → 0 mapping is only a numeric-stock policy and does not preserve the preorder status.

Expected Result

Source valueResultWhy
10+10The example treats this as a lower bound, not an exact quantity.
>1011For integer stock, 11 is the smallest value greater than 10.
4242A supported integer remains unchanged.
out of stock0This is an exact known no-stock marker.
preorder0This is the explicit numeric-stock policy used by the example.
available in 3 daysblankUnknown text must not become a false stock quantity of 3.

Checks Before Export

  • Keep all six rules in the documented order because Eofferix evaluates them from top to bottom.
  • Use Equals for out of stock and preorder, not substring matching.
  • Confirm that >10 becomes 11, not 10.
  • Confirm that unknown text, a negative number, and arbitrary text containing digits all become blank.

Limits of This Example

  • N+ and >N expose a conservative lower bound, not the physical quantity in the warehouse.
  • If the destination distinguishes preorder from out of stock, build a separate status column; the numeric zero cannot retain that distinction.
  • This rule chain accepts non-negative integers only. Add another format only after the supplier has documented its meaning.

Process data faster with Eofferix

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

Sign up