# Unit formulas in Item Classification

Related topics

What this document contains:

User-defined formulas can be defined to calculate the following numeric-related unit information:

• conversion factor
• gross/net weight
• gross/net volume
• length
• height
• width
• package type quantity

The formulas are connected to the applicable formula-related field(s) in the Item classification definition, Units panel. When you apply the Item classification definition to create the item the formula is calculated and the applicable fields are updated in the Item/Units panel for the item that is created.

### Formula for calculating unit information

Per formula you select/combine formula elements to build your formula string (up to 256 characters are available). These formula elements can be based on a combination of the following:

• Characteristic value for a numeric characteristic (i.e. characteristic defined with Field type = Numeric)
• Numeric constants
• Basic operators (* + - /)
• Rounding/Grouping operators which can be used to group operations within a formula and at the same time round the result of that operation to a specific number of decimals (0-9 decimals are allowed). See Rounding/Grouping operators for formulas in Item Classification for more information.

Note There are no rules that govern the entry. You can enter whatever you want and what you enter is what you get. See Unit formula example below for an example of how you can construct a formula.

For unit formulas, a simulation mode is available (by clicking the Simulation function key) where you can test the formula and check what the end result would be when the formula is applied during item creation. It is recommended to run a simulation on any new or changed formula in order to verify that the desired result is being calculated.

#### Unit formula example

This example illustrates a formula to calculate the Gross volume unit data. In this example a formula to calculate square meters is outlined, where BOXLENGTH and BOXWIDTH are valid characteristic codes defined within the Item classification definition. Both characteristics are defined with the following in the Work with characteristics, Header file:

• Field type = Numeric
• Field length = 4
• Number of decimals = 0

Both characteristics hold values in the millimetres (i.e. in the Work with characteristics, Details panel).

In the Work with Item classification formulas file the following formula was created:

This formula (BOXTOSQM) will eventually be connected to the Gross volume UNIT field in an Item classification definition. When items are created using the applicable Item classification definition the UNIT holding formula BOXTOSQM would get its gross volume updated with the result of the values entered for characteristic BOXLENGTH and BOXWIDTH applied within the formula.

BOXLENGTH and BOXWIDTH are expressed in millimetres (mm) for which the resulting square mm of multiplying BOXLENGTH * BOXWIDTH must then be converted to square meters by using a constant factor 1000000. In addition, the result of this operation will be rounded to 5 decimals ( )R5.

Example:

 (BOXLENGTH * BOXWIDTH / 1000000)R5 Multiply measures in mm = (1558 mm * 3758 mm / 1000000)R5 Convert resulting square mm (5854964) into square meters (divide by 1000000) = (5854964 square mm / 1000000)R5 Round result to 5 decimals = (5,854964 square meters)R5 Formula result = 5,85496 square meters

The rounding rules defined for the overall result of the formula are Number of decimals = 3 and no rounding shall be applied (Round result = blank). This means that only the first 3 decimals are retrieved just as they are without rounding anything. Thus, the final result of the formula for the given values would be 5,854 square meters.