Sniffie extension allows you to do any mathematical operations (i.e. functions) to Price column and other numeric data type columns easily. Mathematical operations are new feature introduced in Sniffie v0.7. If you need to remove or add e.g. value added tax to any price or some unit conversions, this is an easy way to do it. Here’s how it works.

Basics of mathematical operations in Sniffie extension

Allowed characters:

  • all numbers (0-9)
  • dot (for decimal separators)
  • multiplication sign (*)
  • division sign (/)
  • addition sign (+)
  • subtraction sign (-)
  • basic parenthesis, i.e. ( and )
  • VAL string (in uppercase, used to point to the original value in the cell)

All non-allowed characters will produce produce  an “Invalid expression” error. In addition, if there is an error in your expression (i.e. it is not valid maths), you’ll get an error. Mathematical operations are the final touch made to your extraction after everything else has been processed. Mathematical operations are not (as of November, 2017) saved to the raw extraction result, but those are applied when the extraction result is imported to Sniffie’s ecommerce platform.

Valid mathematical expression in Sniffie extension
Valid mathematical expression in Sniffie extension. This expression multiplies the original value by 100.

How it works

  1. Activate advanced mode.
  2. Select Price column (or other numeric column data type such as original price).
  3. Write your expression to Math operation field. This will create a mathematical function that is evaluated by Sniffie during extraction. You will see the evaluation result.
  4. If the expression is invalid, you’ll see an error. Otherwise, the expression changes the value in the table immediately.

    Error for invalid expression (val instead of VAL)
    Error for invalid expression (val used instead of VAL). Input field line is now red and an error is shown.
  5. You can combine a regular expression or a standard find/replace with a function. Regular expression is evaluated before the mathematical operation.

Examples

VAL/100

divides the original value by 100 (useful in certain decimal separation cases).

VAL/1.24

divides the original value by 1.24 (i.e. removes 24% value added tax, Finnish VAT rate, from the result).

VAL*2

multiplies the original value of the by two.

(VAL*2)/0.78

multiplies the original value by two and divides the result by 0.78.

(VAL+10)**2

adds 10 to the original value and then squares the resulting value.

(VAL-10)**2/0.72

subtracts 10 to the original value and then squares the resulting value and divides the result by 0.72.