TagDuration()

Returns the aggregated specified tag duration for current entity using current time increment.

Syntax

TagDuration(string tagName, aggregation type aggregationType)

Example

TagDuration("Sand problem", Aggregations.Sum)

Calculates the total time an entity has been active based on the tag "Active."

TagDuration("Active", Aggregations.Sum)

 

Returns the aggregated specified tag duration for current entity using specified time increment.

Syntax

TagDuration(string tagName, aggregation type aggregationType, 
time step expression increment)

Example

TagDuration("Sand problem", Aggregations.Sum, Step Daily)
Calculate the average duration of a workover (assuming workovers are tagged) in a script using a daily increment in the scope.
TagDuration("Workover", Aggregations.Average, Step Hourly)

 


Returns the aggregated specified tag duration for specified entity using specified time increment.

Syntax

TagDuration(string tagName, aggregation type aggregationType, 
time step expression increment, string entityName)

Example

TagDuration("Sand problem", Aggregations.Average, Step Daily, "Well 027")

 

Returns the aggregated specified tag duration in specified time range for specified entity using specified time increment.

Syntax

TagDuration(string tagName, aggregation type aggregationType, 
time step expression increment, string entityName,
date/time startDate, date/time endDate)

Example

TagDuration("Sand problem", Aggregations.Sum, CurrentScopeIncrement(), 
"Well 027", #02/28/2015 08:00#, #02/24/2015 08:00#)
TagDuration("Sand problem", Aggregations.Average, Step Daily,
CurrentEntity(), CurrentScope("Start"), CurrentScope("End"))