Computed attribute creation & edit

Introduction

Computed attributes are attributes whose values are computed from the value of other attributes (observed or computed).

They can be created or modified from the Computed Attribute Edit screen.

Computed Attribute Edit Screen

You can reach this screen from the Attribute Selection screen when you:

  • Create a new blank computed attribute with the Aggregate or Derive hyperlink.
  • Copy or edit an existing attribute.

Attribute Selection Screen

The available features and behavior of this screen depend on the context (creation / edit) and on the type of the attribute (derivation / aggregation).

Settings area

On the Computed Attribute Edit screen, the settings enable you to define the following: 

  • where to store values – Use the Space drop-down.
  • when to compute values – Use the Compute line to define whether values are computed automatically based on a specific rhythm or a defined event. 

Computed using area

This area of the screen may – in supported contexts – give you a choice between Function and Expression modes.

Function mode

This mode enables you to apply one single function to a set of inputs in order to calculate attribute values.

Three types of functions are available:

  1. Standard functions – Accept one or many single cardinality inputs and return a single simple type value (Boolean, Numeric (Decimal, Integer), String, Duration, CalendarDuration, Instant, Interval)
  2. Aggregation functions – Accept only one input that can be either of single or of multiple cardinality
  3. Complex Functions Include:
    • Baseline
    • Thresholds from baseline
    • Classifier from thresholds

Derivation

In the context of a derivation, the user can apply any type of function.

  • If you select a standard function, you can add as many single-cardinality inputs as the selected function supports. To add the necessary inputs, click the Add input button.
  • If you select an aggregation function (Count, Sum, Average, Max, StdDev ...), you can then select a multiple-cardinality input by: 
    • Using a time configuration based on an interval instead of an instant.
    • Selecting a relation as input.
  • If you select a complex function:
    • Baseline – In this case, two special inputs are required:
      • The period for the baseline values.
      • One multiple-cardinality input on which to apply the baseline function.
    • Thresholds from baseline – takes a first input of type Baseline and a second input of type DispersionMultipliers.
    • Classifier from thresholds – takes one input of type Integer, Decimal, Instant or Duration and a second input of type Thresholds.

Aggregation

In the context of an aggregation, you can only use aggregation functions.

Specific features are available in this context:

To select a multiple-cardinality input:

  • Use time configurations based on an interval instead of an instant.
  • Follow a Multiple Cardinality path from the entity on which the attribute is created and the aggregated instances entity.

You can also filter the aggregated instances

 

Expression mode

This mode enables you to enter an expression to define how values will be computed.

Working with expression-based attributes prevents the creation of unnecessary intermediate computed attributes that would be required in function mode.

For example, to compute (indicator1+ indicator2) / (indicator3 + indicator4), in function mode, define an indicator for each sum, and then a third one for the division.

In expression mode, the same can be achieved with a single computed attribute using the expression Div(Add(indicator1, indicator2), Add(indicator3, indicator4)) or the arithmetic expression (indicator1 + indicator2) / (indicator3 + indicator4).

For more information, see Expression-based attributes for more details on how to use this mode.

This mode is only available in the creation/edit of a Derived attribute. 

Important: Once saved in expression mode, an attribute cannot be switched to function mode.

Advantages of expression-based attributes

Expression-based attributes are:

  • Simpler to create & maintain.
  • Faster to execute: Decision Insight shows computations performances up to 4 times faster with a complex expression than an equivalent chain of computed attributes using function mode.

Expression-based attributes limitations

Currently, the expression-based attributes:

  • Are only available when creating or editing a derived attribute.
  • Support less features: no aggregation, no baselines, no threshold evaluations.

 

Related Links