Add feature unit
Features with numeric data types can be provided with units. A conversion to base units allows users to search and sort by values with different units.
Context
Units can be used in numeric asset features.
Prerequisites
This is a standard feature. There are no prerequisites.
Introduction
Units are stored in the Master data of censhare and can be edited in the Admin Client in the "Unit sets" table. There are two ways to configure a unit: A base unit is defined only by its general properties. For a derived unit, a base unit and a conversion factor need to be specified. Currently, over 530 units are available in the master data. However, not all are enabled in the standard configuration. You can activate them separately in the "Units" table of the Master data. All units are based on the "Unified Code for Units of Measure" (UCUM). More information at http://unitsofmeasure.org.
In order to make units available in an asset feature, first, you have to define a unit set. Unit sets represent a group of derived units with a base unit. For example, the unit set "Weight" consists of the base unit "gram" and the derived units "kilogram" and "tonne" (metric). You can create your own unit sets in the censhare Admin Client. If a unit set is defined in an asset feature, then the units of the assigned unit set are shown in the asset properties dialog.
Users can also search for values and units. The different units of a set are recognized and converted automatically. For example, if the weight is "15 kg" in an asset, users can search for "weight = 15 kg", but also "weight = 15,000 g" or "weight = 0.015 t". All three searches will deliver the same result, no matter what unit is stored in the asset.
Unit sets can be assigned to features with the value type "Floating point number (Double)" or "Floating point number pair (Double)".
Base units and derived units
Each unit has an ID, a name and a symbol. The "Property" and the "Category" store additional information, for example, if it is a volume unit or if it is an ISO unit. From a base unit (for example: meter) derived units (for example, kilometers) can be created. These units have an additional conversion factor (for example 1000). Thus, by specifying a base unit, these units can be converted.
Unit sets
For units to be grouped in a unit set, they must be convertible by a factor. Each derived unit is referenced to the base unit. These references are not cascaded. For example, the units "kilogram" and "tonne" (metric) are based on the unit "gram" and have the conversion factors 1,000 and 1,000,000, respectively.
Unit sets are used to map units in groups. The unit sets currency, distance, weight, length, duration, and typography-length and working times are pre-installed as a standard. Non-metric units (feet) and metric units (meters) can be combined. Each unit set can be defined by ID, name and domain permissions. When you create your own unit sets or edit the existing ones, make sure that all units have the same base unit and that this base unit is part of the unit set. Otherwise, censhare cannot calculate and convert the correct values when a user executes a search.
Note: Only unit sets can be assigned to an asset feature. Even if you want to assign a single unit to an asset feature, you have to create a unit set from this unit.
Next steps
You can now assign a unit set to an asset feature.