AggregateIfTagged

Returns the aggregated value according to the specified aggregation type of the specified PetroVisor signal, only when the specified tag is active at the current time step.

AggregateIfTagged(Expression, string, string)

Syntax:

Expression: Numeric expression

String: Tag Name

String: Aggregation Type

Arguments:

  1. Data expression (signal with units)
  2. Tag Name
  3. Aggregation type
    1. Min
    2. Max
    3. Sum
    4. Average
    5. First
    6. Last
    7. Count
    8. Median
    9. Standard Deviation
    10. Variance
    11. Percentile
  4. Option - optional, if this argument is not specified, option Always will be used
    1. Start: returns on aggregated value at the time point of tag range start date
    2. End: returns on aggregated value at the time point of tag range end date
    3. Always: returns the same aggregated value for every time point of tag range
    4. Condition: returns one aggregated value at the time step it is located - not valid for aggregation types: Sum, Average, Median, and Count

Example:

AggregateIfTagged("oil production rate" in "m3/h", "Water coning", "Average")

AggregateIfTagged("oil production rate" in "m3/h", "Sand problem", "Sum", "Start")