AggregateFromEntities()

Returns the aggregated value of the specified PetroVisor numerical signal or expression at each time step in the scope according to the specified aggregation type, for all entities defined by an entity set expression.

Aggregation types

1. Min: returns the minimum value of the specified signal from the specified entity set at each time step.
2. Max: returns the maximum value of the specified signal from the specified entity set at each time step.

3. Sum: returns the sum of the values of the specified signal from the specified entity set at each time step.

4. Average: returns the average of the values of the specified signal from the specified entity set at each time step.

5. First: returns the first non-null value of the specified signal from the alpha-sorted specified entity set at each time step.

6. Last: returns the last non-null value of the specified signal from the alpha-sorted specified entity set at each time step.

Syntax

AggregateFromEntities(signal expression, aggregation type, entity set expression)
  • signal expression: any valid numerical signal name with an accompanying unit, in the form: "signal name" in "unit". This must be a numerical signal. Text signals cannot be aggregated.
  • aggregation type: type of aggregation (see above)
  • entity set expression: list of entities defined by a valid entity set expression.

Examples

Example 1: passing an entity set expression using EntitiesByCondition() to the 
function to compute the sum for the aggregation.

AggregateFromEntities("oil production rate" in "m3/h", Aggregations.Sum,
EntitiesByCondition(
"country" in " " = "USA" or
"country" in " " = "Austria"
)
)
Example 2: passing a delimited list of entity names using EntitiesFromDelimitedList() 
to the function to compute an average for the aggregation.

AggregateFromEntities("oil production rate" in "m3/h", Aggregations.Average,
EntitiesFromDelimitedList(
"Well1|Well2|Well 12", "|"
)
)
Example 3: passing an existing entity set using EntitiesFromEntitySet() to the 
function to compute the sum for the aggregation.

AggregateFromEntities("oil production rate" in "m3/h", Aggregations.Sum,
EntitiesFromEntitySet("All Wells")
)