Using an Enumerated Attribute in a Calculated Indicator

In this example, the value of a numeric indicator is calculated based on the Active Status of an asset. The Active Status is an enumerated attribute that has two possible values:
When referring to an enumerated value in the calculation string, you can use either the enumerated value’s integer or its corresponding constant (for example, c_Active). Constants are defined for you in the box above the calculation. In either case, you do not need to use quotation marks. The calculation has the four following inputs:
Note: Because StatusInput is a reading-based input, the indicator used to create the input must have at least one reading entered for the input to have a value.
This calculation does the following: If the asset status is c_Active, then the value of the calculated indicator is determined by adding together the value of Input2 and Input3. Otherwise, the indicator’s value is equal to what it is presently (that is, Input4).
For example:

VB.NET

’if the asset status is Active, calculate a value, otherwise don’t
If StatusInput = c_Active Then
Return Input2 + Input3
Else
Return Input4
’Input4 is the current value
End if

C#

//if the asset status is Active calculate a value, otherwise don’t
if (StatusInput == c_Active)
{
return Input2 + Input3;
}
else
{
return Input4;
//Input4 is the current value
}