Any history in the station can be queried using bql. The bql query builder can be used to create the query or you can simply type the syntax below.
history:/demo/BldgKw|bql:select *
The above bql query will return a table which contains all of the records available in the referenced history. If the export source object is executed once a week, then it would probably be safe to limit the query to the previous weeks worth of data. The period syntax can be used to limit the query as below.
history:/demo/BldgKw?period=lastWeek|bql:select *This will still return a significant amount of data. Assuming that the data is recorded in fifteen minute intervals, this would return 672 records and the pdf file would span seventeen pages. Bql includes a special function called history rollup. This function can be applied to the previous query to display the same results using fewer records. Each record in the rollup indicates the number of samples, minimum value, maximum value, average value and a sum of all samples. The below example uses the history rollup function with a daily interval which results in only seven records (one for each day of the week) displayed in the table.
history:/demo/BldgKw?period=lastWeek|
bql:history:HistoryRollup.rollup(baja:RelTime '86400000')In some cases it may be a requirement to display the data in chart form as opposed to using a table. The chart palette includes two types of chart widgets, the line and bar chart. After adding the line chart widget to the Px file, table chart bindings may be added and configured. The previous query can be used in the ord field of the table chart binding. Each table chart binding represents one trace on the chart and must specify which column of the query to display on the Y axis. Multiple table chart bindings can reference the same query but display different columns such as min, max, avg or sum.
