Skip to content

Consumption Pivot ​

About 7 min read

The screen that opens when you select History > Consumption Pivot in the menu shows the consumption of the selected tags as a pivot table. Consumption is first calculated for short periods (hourly by default) and then added up in the table by process group, tag and calendar breakdowns (year, quarter, month, day). An optional column chart can be opened above the table.

At the top of the screen is the report menu, below it the Filters section, and at the bottom the pivot table. The report menu is the same as the report menu in Trend Analysis; reports are shared by all History screens.

For the consumption calculation, the tag's log definition must have the Consumption Value Type (Cumulative or Instant) and, if needed, the Factor, Divisor and Unit defined (see Log (Archive) Definitions).

Filters ​

The Filters section has the following fields:

  • Date range: The predefined ranges and the Custom option are used as in Trend Analysis.
  • Sample Time [s]: The length (in seconds) of the period for which consumption is calculated. The default value is 3600 (one hour). The H, D and M buttons in the box set the time to one hour, one day and one month respectively. The day, month and year totals in the pivot table are formed by adding up these periods.
  • Fill Type: Sets how a period is filled if it has no records (NULL, PREV, LINEAR, ZERO; see Report menu). The default is NULL; a period without records is not included in the total.
  • Align To Calendar: Off by default on this screen (see Calendar alignment).

After setting the options, click Update to run the query.

How consumption is calculated ​

For each log definition, the consumption of periods of length Sample Time [s] is found first:

Consumption Value TypePeriod consumption
CumulativeThe sum of the increases between consecutive records, starting from the last record before the period. If a record is smaller than the previous one (the counter was reset or replaced), the increase for that step is counted as 0.
InstantThe sum of the records in the period
NoneThe sum of the records in the period

The result is multiplied by the Factor and divided by the Divisor. The pivot table adds up these period values by the row and column breakdowns.

The counter rule is the same as on the Consumptions screen: the increase between periods is also counted, the base reading is searched for at most 31 days back, and a period without a base reading is marked as a data gap. For the same tag, range and period, the two screens give the same result.

Calendar alignment ​

In the pivot table, a period is written to the year, quarter, month and day of the time it starts.

  • When Align To Calendar is on, the periods start at calendar boundaries in the browser's time zone (hourly periods on the hour, daily periods at midnight). The day and month totals match the calendar day and month.
  • When Align To Calendar is off, the periods start from the first record of each log definition in the selected range. For example, if one of the hourly periods starts at 23:30, the consumption of the first half hour of the next day is also written to the previous day.

If the day and month totals must match the calendar exactly, turn on Align To Calendar.

Pivot table ​

In the default layout:

  • The rows contain Process Group and, below it, Desc. Desc is the description of the log definition followed by its unit in square brackets; the unit is the Unit in the log definition, or the tag's unit if that is empty. Process groups are sorted by total consumption from largest to smallest.
  • The columns contain the Year, Quarter, Month and Day breakdowns.
  • The cells show the sum of the Value field, that is, the consumption. Subtotals and the Grand Total come before the related columns.

The field panel above the table shows the row, column and data fields. You can drag fields to move them from rows to columns, change their order or remove them. The Task Center and Hour fields, which are not used in the default layout, can be added from the Field Chooser window, which opens with the Show Field Chooser command in the table's right-click menu.

The plus/minus signs in the row and column headers expand and collapse the breakdowns; the Expand All and Collapse All commands in the right-click menu expand or collapse all breakdowns of a field together. Click the headers to sort, and use the filter icon in the field headers to apply a value filter.

The table layout (the position of the fields, expanded breakdowns, sorting and filters) is stored in the browser and restored when the screen is opened again. The layout is specific to the browser; the same layout is used for all reports.

Toolbar ​

The toolbar at the top right of the pivot table has the following buttons, from left to right:

  • Chart view: Opens or closes the chart above the table (see Chart).
  • Reset grid state: Returns the pivot table layout to the default.
  • Refresh button: Runs the query again.
  • Fullscreen: Enlarges the pivot table to fill the screen; clicking it again (Exit fullscreen) returns it to its previous size.
  • Tag Selection: Opens the Chart Options window.

The only tab of the Chart Options window is Tag Selection. On this tab you change the Start date and End date, select tags in the Tags tree and check the log definitions of the selected tags in the Logs list. Users with the Editor role can select tags from the process group, task center and device tree with the Tag Selection By Process Tree switch. Close the window with the Ok button; to query with the new selection, use Update or the refresh button.

Chart ​

When Chart view is turned on, a column chart showing the data in the table is drawn above the pivot table. The chart follows the current layout of the table: expanded breakdowns also appear in the chart. When you hover over a column, the series name and the consumption value are shown.

The buttons at the top right of the chart:

  • Save as image: Downloads the chart as a JPG image.
  • Chart Options: Opens or closes the options row below the chart.

The options row has the following settings:

  • The first list (Series / Args): Sets whether the data fields are used as series in the chart or as arguments on the horizontal axis. The default is Series.
  • The second list (Single axis / Multiple axes / Split panes): When there is more than one data field, sets whether the values are shown on a single axis, on separate axes or in separate chart panes. The default is Split panes.
  • Alternate fields: Changes the arrangement of the data fields in the chart.

The chart is redrawn when a setting changes.

Data gap and partial period information ​

If one of the displayed periods contains a data gap or the last period is not complete yet, an information line appears above the pivot table:

  • With a warning icon: Some periods have data gaps; consumption may be understated.
  • With a clock icon: The latest period is not finished yet; its values are partial.

How a data gap is determined is described on the Consumption and Snapshots page. The information line does not show which cell is affected; the raw records of doubtful periods can be reviewed on the Trend Analysis screen.

Exporting ​

The pivot table's own Excel export button exports the table with its on-screen layout to an Excel file. The file name consists of the report name and the start and end dates of the date range (for example <report>_20261001_20261031.xlsx). Download the chart separately with the chart's Save as image button.

Query limits ​

The number of log definitions that can be selected in one query is limited; if the limit is exceeded, the A maximum of {maximum} variables can be selected in one query. warning appears. If the selected range and the number of log definitions produce too many periods, Sample Time [s] is increased automatically and the The sampling interval was increased to {seconds} seconds to keep the service safe. warning appears. The limits come from the server settings.

2WinScada 2.10