EZ Exporter Calculated Fields - Arithmetic Operations

Arithmetic operations provide a way to generate new values from one or more number fields (e.g. total_weight, total_price, line_items.quantity, etc.).

AVAILABLE OPERATORS

  • + (add, 1 + 1 = 2)
  • - (subtract, 5 -1 = 4)
  • / (divide, 10 / 2 = 5)
  • * (multiply, 3 * 2 = 6)
  • ** (exponent, 2 ** 3 = 8)
  • % (modulus/remainder, 15 % 4 = 3)

EXAMPLES

I want an additional column that will give me the order's total_weight in pounds as the default weight is in grams.

{{ total_weight }} * 0.0022046

I want an additional column showing the order's total_price with 40% off before taxes.

({{ total_price }} - {{ total_tax }}) * 0.60

I want a column showing the Lineitem Unit Price after Discounts.

({{ line_items.total_price }} - ({{ line_items.discount_allocations.total_amount }} or 0)) / {{ line_items.quantity }}

This one's a little more complex as the Lineitem Discount Allocation data could be empty if no discount was applied to the line item. To properly handle this, we simply add the part "or 0" which basically says "if the data is empty, substitute the value of 0."


App: EZ Exporter

Tags: advanced features