Querying Calculated Data
About this task
Note: If you
attempt to perform a query with two worksheets open, the add-in may become unstable
and unresponsive. This is a known Microsoft Excel issue. To avoid this issue, work
with only one Excel spreadsheet at a time.
Procedure
- Open an Excel worksheet.
-
Select
.The Historian Calculated Query window appears.
-
Select the Historian server from the drop-down list box. If you do not specify
a server, the default server is considered.
Tip: To set the selected server as default, ensure that the Set Server to Default option is enabled.
-
Select a tag on your worksheet, and then place the cursor in the Tag
Name field.
Optionally, you can select the tag from the Advance Tag Search window. For more information, refer to Advanced Tag Search.The tag name is automatically entered. You can also enter a tag name manually in the Tag Name field.
-
Enter values as described in the following table.
Field Description Query Time Enter the start time and end time for the query. You can also use relative time entries. Query Criteria String Enter the query criteria along with the # symbol. For example, if the query criteria string is to retrieve only good data quality values, enter #ONLYGOOD. For more information, see Query Modifiers. Sampling Type Select the sampling type. For information, refer to Sampling Types. Calculation Select a calculation algorithm. This field is enabled only if you select Calculated Sampling in the Sampling Type field. Sampling Interval Select one of the following options: - By Interval: Using this option, you can query the data for a specific interval. option displays two entry fields, and . Enter values in both. For example, if you want to query the data for 10-minute intervals, enter 10 in the Interval field, and select Minutes in the Time Unit field.
- By Samples: Using this option, you can query the data for a specific number of samples. For example, to query 100 samples, enter 100 in the Number of Samples field.
State Value Enter the state value. This field is enabled only if you selected Calculated in the Sampling Type field and if you selected State Count or State Time in the Calculation Field field. Output Display Select one or more parameters for the output. Output Range Select a range of cells in a single row or column to determine where the returned data is placed. Rows or Columns Select either Columns or Rows for the output display. Selecting Columns displays a table of values with parameters arranged in columns with header labels at the top. Selecting Rows rotates the table 90 degrees. Ascending or Descending Specify the order of the retrieved data. -
Select OK.
The query returns a number of data points based on the number of rows or columns specified in the output range. If all the data points do not appear, select enough rows or columns to display all the data.Note:
- For an array tag, each element is displayed in separate rows with the tag name and index.
- The TagStats Calculation mode is not supported.