Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Historian

WideHistory (INSQL​.Runtime​.dbo​.WideHistory)

WideHistory (INSQL​.Runtime​.dbo​.WideHistory)

  • Last UpdatedMar 10, 2025
  • 6 minute read

Contains one row of values for multiple analog, discrete, or string tags for a single timestamp, thus providing a "wide" view of the data.

Because tagnames are used as column names for the returned data (indicated by Tag1, Tag2, and ManyOtherTags), the value data types will be of the appropriate type for associated tags.

Column

Data Type

Description

DateTime

datetime2(7) NOT NULL

The timestamp for the returned value. For delta retrieval, this is typically the time at which the value was acquired by the AVEVA Historian. For cyclic retrieval, this is the specific time requested or calculated (using a SQL function).

Tag1

(as per the tag type) NULL

The name of a tag to query.

Tag2

(as per the tag type) NULL

The name of a tag to query.

ManyOtherTags

(as per the tag type) NULL

A "placeholder" column for one or more tags in the wide table format. In the wide table format, tagnames are used as column names. The ManyOtherTags column is "duplicated" for as many tags as are specified in the database query.

wwRowCount

int NULL

The number of rows to be returned for a specified time period. For cyclic retrieval, the rows are spaced evenly across the time period, and the default row count is 100 rows. For cyclic retrieval, the row count is applied for each tag in a query. This parameter has been deprecated; do not use. Use the wwCycleCount parameter instead.

wwResolution

int NULL

The sampling rate, in milliseconds, for retrieving the data in cyclic mode. The system returns values stored over the requested time period at the interval specified by the resolution. For example, if you specify a 5000 ms resolution, the system queries for all data during the time period and then only returns those values that occur at each 5000 ms interval, starting with the start date and ending with the end date.

wwEdgeDetection

nvarchar(16) NULL

The type of edge detection result set that the query will return. Valid values are NONE, LEADING, TRAILING, and BOTH.

wwRetrievalMode

nvarchar(16) NULL

Used to specify how retrieved data is processed before it is returned to the client. Valid values are: CYCLIC, DELTA, FULL, INTERPOLATED, BESTFIT, AVERAGE, MINIMUM, MAXIMUM, INTEGRAL, SLOPE, COUNTER, VALUESTATE, and ROUNDTRIP. FULL = All stored values are returned; CYCLIC = All stored data for tags during the specified time interval are returned for the number of retrieval cycles or resolution specified; DELTA = Only values that changed during the specified time interval are returned. For all other modes, a calculation is performed by the system on the data and the value(s) are returned. The default is CYCLIC for retrieval from analog tables, DELTA for retrieval from discrete and string tables, and default is DELTA for retrieval from the History table, unless the specific retrieval mode implies otherwise. For example, SLOPE always has DELTA characteristics.

The default value for wwRetrievalMode is DELTA.

wwTimeDeadband

int NULL

The minimum time, in milliseconds, between returned values for a single tag. Applies only to delta retrieval.

wwValueDeadband

real NULL

The percentage of full scale (range), in engineering units. Any value changes that are less than this percentage are not returned. Applies only to delta retrieval. The default is 0.

wwTimeZone

nvarchar(50) NULL

Used to specify the time zone for retrieval. By default, the retrieval subsystem converts the UTC (Universal Time Coordinated) timestamps for the stored data to the local time of the AVEVA Historian computer, including adjustments for daylight savings time. To keep the timestamps in UTC, set the value of wwTimeZone to UTC. To convert the timestamps to a client computer's time zone, set this parameter to the appropriate time zone text key from the TimeZone table.

wwVersion

nvarchar(30) NULL

If the original data values have been modified in the database, use this column to specify which version of the stored data is to be retrieved. Valid values are: ORIGINAL or LATEST. If no parameter is specified, the latest version of the data is retrieved by default. Modification is indicated by the QualityDetail.

wwCycleCount

int NULL

The number of retrieval cycles (sub-intervals) for the specified time period. The cycles will be spaced evenly across the time period. For example, if you specify a cycle count of four, the time period will be divided into four even cycles, and one or more values (depending on the retrieval mode) will be returned per cycle.

wwTimeStampRule

nvarchar(20) NULL

Used to specify whether cyclic results are timestamped at the beginning of the cycle or at the end of the cycle. Valid values are START and END. If no timestamp rule is specified in the query, then retrieval uses the setting of the TimeStampRule system parameter.

wwInterpolationType

nvarchar(20) NULL

Used to determine which analog value to return at a given cycle boundary. Valid values are STAIRSTEP and LINEAR. If STAIRSTEP is specified, no interpolation occurs. The last known point is returned with the given cycle time. If no valid value can be found, a NULL is returned. If LINEAR is specified, the system calculates a new value at the given cycle time by interpolating between the last known value prior to the cycle time and the first value after the cycle time.

wwQualityRule

nvarchar(20) NULL

Used to specify whether values with certain characteristics are explicitly excluded from consideration by data retrieval. This parameter will override the setting of the QualityRule system parameter. Valid values are GOOD, EXTENDED, or OPTIMISTIC.

A quality rule of GOOD means that data values with doubtful (64) OPC quality will not be used in the retrieval calculations and will be ignored. Values with bad QualityDetail indicate gaps in the data.

A quality rule of EXTENDED means that data values with both good and doubtful OPC quality will be used in the retrieval calculations. Values with bad QualityDetail indicate gaps in the data.

A quality rule of OPTIMISTIC means that calculations that include some good and some NULL values will not cause the overall calculations to return NULL.

You can apply wwQualityRule to all retrieval modes.

wwValueSelector

nvarchar(20) NULL

Used to specify which column to return for specified analog summary tags in the four basic retrieval modes, DELTA, FULL, CYCLIC, and INTERPOLATED. The defined set of selectors are AUTO (the default in all modes if not overridden), MINIMUM or MIN, MAXIMUM or MAX, FIRST, LAST, AVERAGE or AVG, and INTEGRAL. The default AUTO setting returns the Last attribute in the Value column (which makes it accessible in the WideHistory table). You can only override the selector for the basic retrieval modes.

wwFilter

nvarchar(512) NOT NULL

Gives the name of the filter. Filters are specified as C-like functions and parentheses are always required, even when the filter does not override the default parameters (no parameters are passed). Filter values are NoFilter, ToDiscrete(), SigmaLimit(), SnapTo(), and SLR(). The default value is NoFilter. If the query does not specify the wwFilter element at all, or if its default value is not overridden, then no filter is applied.

wwParameters

nvarchar(128) NULL

Contains the "stream index" (used for informational purposes only) and the special index value to indicate that the value was calculated by the "SLR()" filter. SLR stands for "simple linear regression," the algorithm used for predictive retrieval. By default, the value of this parameter is an empty string.

StartDateTime

datetime2(7) NOT NULL

Start time of the retrieval cycle for which this row is returned.

wwExpression

nvarchar(4000) NULL

Used to specify an expression for unit of measure conversion, specified in the following format using tag/unit pairs:

UOM(TAG1,UNIT1;TAG2,UNIT2;...)

For example, the expression UOM(DistanceTag,m;TempTag,F;DurationTag,Minute)returns the values for the tag named DistanceTag measured in meters, the values for TempTag measured in degrees Farenheit, and the values for DurationTag measured in minutes.

The following rules apply:

  1. If any of the unit conversions specified are invalid and fail (for example, trying to convert a tag measured in meters to a unit of hours) then no unit conversions are performed.

  2. If any tags specified in the expression for unit conversion are not part of the query, those tags will be ignored for the purpose of unit conversion.

wwUnit

nvarchar(512) NULL

Returns the currently used unit of measure.

Related Links
TitleResults for “How to create a CRG?”Also Available in