Concepts > Attributes (MetaAttributes) > Status and Value Calculation Rule
Status and Value Calculation Rule
This vb script code computes the value of the indicator.
The result of this computation is displayed in the 'Actual Value' property of the indicator.
 
Status and Value computation
To return the indicator value, store it in an implicit variable named value.
To return the indicator status, store it in an implicit variable named status.
Other implicit variables are:
- oIndicator: the current indicator itself.
- oMonitoredObject: A reference to the monitored object the indicator is linked to. The reference is set if the status and the value are requested from the link between the monitored object and the indicator. Else the variable is set to nothing.
- Excel: a reference to a WorksheetFunction variable. This reference allows the access to all Excel mathematical functions. If Microsoft Excel is not installed on the machine, the access fails. For more details, refer to the Microsoft Excel documentation.
 
Sub-indicators
To compute value using sub-indicators, drag and drop them in any vb script statement.
The bold displayed name will be replaced by the value during the computation.
 
Related objects
In the simulation editor, the indicator shows related objects. Any attribute of these objects can be dragged and dropped.
Then, two fields are inserted separated by a dot: the object name and the attribute name.
This formula will return the value of the inserted object regarding the current hypothesis.
If the seek attribute is a duration, the value returned is the number of seconds.
 
Time
When the attribute value is a time expressed in number of seconds, it can be converted using the following functions:
- dayOf(aTime): returns the number of days.
- hourOf(aTime): returns the number of hours including the day hours.
- minuteOf(aTime): returns the number of minutes including the hour minutes.
 
Examples
 
' -------------------------------
' The two sub-indicators have been drag and dropped in the vb code.
value = subIndicator1 + subIndicator2
 
' -------------------------------
' Computes the hyperbolic sinus of one sub-indicator.
value = Excel.sinh (subIndicator1)
 
'To be coded in an associated Calculation Macro
' -------------------------------
' Computes the sum of all sub-indicator unknowing how many they are in advance.
' Refer to the MEGA Api for more details.
value = 0
for each oSubIndicator in oIndicator.[Sub-Indicator]
value = value + oSubIndicator.[Actual Value]
next
 
 
Translations
Type
VarChar (4) Standard
 
List of MetaClasses