Change the units for calculations
Each box on the diagram shows the units of that item, centred in the lower half of the box. While units are optional, they are highly recommended because they are another way of avoiding model errors. They allow Openbox to warn you about equations which make no sense because they combine inputs in a way that “adds apples and oranges”. For example, there might be two calculations in the model, one in Euros and one in US dollars. These should not be combined without applying an exchange rate.
Units are calculated for each formula, based on the calculations that feed into it. For example, if a calculation takes a number in Euros, and divides it by a number in tonnes, the result must have units of “Euros per tonne”. Openbox will warn you if this is not the case by highlighting the units in red.
Move your mouse over the units text to see a description of what the problem is. In this case, it would be something like “Expected units are EUR per tonne, but actual units are EUR”.
If you double click on red units text, Openbox will bring up a list of possible units.
You can also click “Use expected” at this point to have Openbox set them automatically to the correct value.
This is not a complete guarantee that a formula will be correct – there are other types of error that can occur. But it does prevent many common ones.
Setting the units for one calculation
To set units, just click the units text on each item, or press Ctrl+Shift+U. You can use any text values you wish for units, or pick one from the list of those already in the model.
Conversely, if you prefer not to enter the units yourself, you can ask Openbox to work them out for you using the ‘Auto Units’ menu. Just set the units for all inputs, and then press the ‘Units – Auto Units’ menu. Openbox will set the units for everything that it can.
Each model has a ‘default’ unit, which will be applied to all new calculations when they are created. Usually, this is the currency of the model.
You can also apply the default unit to any calculations in the model that do not have units, or just to the selected calculations. Click ‘Units’, then ‘Apply Default to Selection’ or ‘Apply Default to Entire Model’.
Often you want to review all the units in a model and change, merge or delete them. To do this, click ‘Units’ then ‘Manage units’.
You will see a list of all the units used in the model (except a few built-in units such as ‘%’). The default unit will be highlighted in bold.
You can rename any unit by clicking on it and editing the name. This will be applied everywhere in the model that that unit is used. Note that you can change the name to the same name as an existing unit and this will effectively merge those units. If you have, for example, USD 000s and USD000s in your model, and you want to standardise on USD 000s, change the USD000s unit name to USD 000s.
You can also delete units by ticking them and pressing the ‘Delete’ button. Any calculations with those units will now have their units set to ‘<none>’.
Finally, you can change the model default unit by ticking it and pressing the ‘Default’ button.