Dimensions

The dimension administrative object provides the ability to associate units of measure with an attribute, and then convert displayed values among any of the units defined for that dimension.

For example, a dimension of Length could have units of centimeter, millimeter, meter, inch and foot defined. Dimensions are used only with attributes. For more information, see MQL Command Reference: Dimension Clause for the Add Attribute Command.

This page discusses:

About Dimension Units

The definition of the units for a dimension includes determining which unit will be the default (the normalized unit for the dimension), and the conversion formulas from that default to the other units. The conversion formulas are based on a multiplier and offset entered when the unit is defined. The normalized unit has a multiplier of 1 and an offset of 0.

To convert to the normalized value stored in the database to a different unit, the system uses this formula:

normalized value = unit value * multiplier + offset

To display a value in units other than the normalized units, the system uses this formula:

unit value = (normalized value - offset) / multiplier

Only the normalized value is stored in the database. When an application requires the value for an attribute to be displayed, the system converts the normalized value to the units required. The value can be entered in any supported unit of the dimension, but it will be converted and stored in the default units.

Real attributed normalized values are stored with the same precision as real attributed values with no dimension applied. For more information, see Attributes. To avoid round-off errors with integer attributes, the default units should be the smallest unit (for example, millimeters rather than centimeters or meters).

The conversion process affects the precision. In general, up to 12 digits of precision can be assumed. For each order of magnitude that the offset and the converted value differ, another digit of precision is lost.

Dimensions help qualify attributes that quantify an object. For example, for a type with an attributed Weight, the user needs to know if the value should be in pounds or kilograms, or another dimension of weight. When the attribute definition includes a dimension, the user is provided with that information in the user interface. In addition, the user has the ability to choose the units of the dimension to enter values.

When applying dimensions to attributes that already belong to business object instantiations, see Applying a Dimension to an Existing Attribute for information on converting the existing values to the required normalized value.

Choosing the Default Units

Before you define a dimension, you need to decide which units of that dimension will be the default. That unit will have a multiplier of 1 and an offset of 0. You must calculate the multiplier and offset values for all other units of the dimension based on the default.

For example, the following table shows the definition for a Temperature dimension normalized on Fahrenheit:

Unit Label Multiplier Offset
Fahrenheit degrees Fahrenheit 1 0
Celsius degrees Celsius 1.8 32

If you wanted to normalize the dimension on Celsius, you would enter these values when defining the units:

Unit Label Multiplier Offset
Fahrenheit degrees Fahrenheit .555555555555555 17.777777777777777
Celsius degrees Celsius 1 0

For dimension definitions that are to be applied to an integer, all multiplier and offset values in the dimension should be whole numbers, and the smallest unit should be the default.