Unit Analysis
How to keep track of Units when creating a Calculation
Last updated
How to keep track of Units when creating a Calculation
Last updated
The Calculation page analyses the Unit of your Calculation as you are creating it. This helps you check your Calculation for logical consistency, and provides clues to the Unit of Variables required to finish your Calculation.
The Calculation page shows two or three items:
Target Unit | The Unit of the Variable in which we are creating the Calculation. Note: If you haven't defined a Unit for the Variable, this will be guessed based on context |
Current Unit | The Unit currently produced by the Calculation. This item will show warning messages if a Unit cannot be determined. |
Remaining Unit | The Unit required to finish the Calculation with the Target Unit.
The remaining Unit will only be shown if the entered formula is empty ends in an operator ( |
In this example, we are creating a Variable called Gym Revenues
, which is equal to Gym members * Revenue per member
.
Gym Revenues
has a Unit of GBP
.
To begin with we have an empty formula. Target Unit shows our desired Unit (GBP
). Current Unit shows that the Calculation is not currently valid. Remaining Unit shows that if we reference a Variable with Unit GBP
we will have the correct Unit.
We enter a reference to Gym Members
. This updates the Current Unit to Member
, and alerts us that Member
does not match the Target Unit of GBP
. We have not entered an operator, so Models cannot determine the Remaining Unit.
We enter a *
(multiply) operator. Models can now work out that we need to reference a Variable with Unit GBP / Member
in order to arrive at the Target Unit, as Current Unit * Remaining Unit = Target Unit.
We add a reference to the Revenue per member
Variable, which has Unit GBP / Member
.
The Current Unit now matches the Target Unit.
At this point, if we click on the Add Variable Reference button in the Calculation Part list, we will be shown only Variables that match the Remaining Unit of GBP / Member
.