Consumptions
The screen that opens when you select History > Consumptions in the menu calculates the consumption for each period from the history (log) records of the selected tags and shows the result as a column chart and a table. It is used for continuously increasing counters, such as energy, water or gas meters, and for instantaneous consumption values.
The screen has the same structure as Trend Analysis: the report menu at the top, below it the collapsible Filters section, and at the bottom the chart and table section. This page describes only the settings and behavior specific to the Consumptions screen.
Prerequisites
For the consumption of a tag to be shown on this screen:
- The tag must have a log definition.
- In the Consumption & Run/Stop step of the log definition, the Consumption Value Type must be set to suit the tag: Cumulative for continuously increasing counters, Instant for instantaneous values.
- If needed, Factor, Divisor and Unit must be entered in the same step.
Log definitions whose Consumption Value Type is None can also be selected; for these logs the records in the period are added up as for Instant. For counter values this result is not meaningful.
Report menu
The report menu is the same as the report menu in Trend Analysis. Reports are shared by all History screens; a report opened on the Consumptions screen is also listed in Trend Analysis. When a report is opened, its tags and saved settings (for example the consumption period and Align To Calendar) are loaded into the screen.
Filters
The Filters section has the following fields:
- Date range: The predefined ranges and the Custom option are used as in Trend Analysis. When Custom is selected, the Start date and End date fields appear.
- Consumption Period: Sets the periods the consumption is split into: Hour, Day, Month or Year. The default value is Hour.
- Align To Calendar: Sets whether periods start at calendar boundaries. On by default (see Calendar alignment).
Unlike Trend Analysis, this screen has no Sample Active, Calculate Consumption, Fill Type and Value Type fields; consumption is always calculated.
After setting the options, click Update to run the query. If no tag is selected, the No log item selected! warning appears.
How consumption is calculated
Each log definition is calculated separately. The consumption of a period is found as follows, depending on the Consumption Value Type in the log definition:
| Consumption Value Type | Period consumption |
|---|---|
| Cumulative | The sum of the increases between consecutive records, starting from the last record before the period |
| Instant | The sum of the records in the period |
| None | The sum of the records in the period |
The result is multiplied by the Factor and divided by the Divisor. If there are no records in a period, the value of that period stays empty.
Counter (Cumulative) rule
For Cumulative logs, consumption is calculated with the following rule:
- The calculation starts from the last record before the start of the period (the base reading). For each record, the increase over the previous record is found, and the increase is written to the period the record's time falls in. In this way the increase between the last record of a period and the first record of the next period is also counted.
- If a record is smaller than the previous one (the counter was reset, overflowed or replaced), the increase for that step is counted as 0; no negative consumption occurs. The consumption up to the first record after the reset is therefore lost.
- The base reading is searched for at most 31 days back. In the first period of a new counter, or for a counter that has not written any records for more than 31 days, no base reading is found; the first step of this period cannot be calculated and the period is marked as a data gap.
The same rule is used on the Consumptions screen, in Consumption Pivot, in page widgets and in consumption snapshots; for the same tag, range and period these screens give the same result.
Calendar alignment
When Align To Calendar is on, the periods are aligned to the calendar in the time zone of the browser the page is opened in:
- Hour periods start on the hour,
- Day periods at midnight,
- Month periods on the first day of the month,
- Year periods on January 1.
When Align To Calendar is off, the periods start from the first record of each log definition in the selected range. In this case the periods do not match calendar boundaries, and the periods of different log definitions may be shifted relative to each other. Keep Align To Calendar on for daily, monthly or yearly consumption reports.
Partial period and data gap
If a Cumulative log has no base reading in one of the displayed periods (see Counter rule), the message Some periods have data gaps; consumption may be understated. appears with a warning icon above the chart. The message line does not show which period is affected. The screen does not show a partial period icon; keep the following in mind when evaluating the periods:
- Partial period: If the selected range does not match period boundaries, the first and last periods cover only the part within the range. For example, when the Day period is selected with the Today range, today's value is the consumption up to now; the current hour or month is not complete yet either.
- Data gap: Periods without records appear empty. In periods where some of the records are missing, the consumption may be lower than it really is. The raw records of a doubtful period can be reviewed on the Trend Analysis screen.
The data gap and partial period indicators are used in the consumption widgets on pages; for details, see the Consumption and Snapshots page.
Chart and table
The toolbar, zoom, Chart Settings window and series selection of the chart and table section are the same as in Trend Analysis (see Reporting). The points specific to the Consumptions screen are:
- Each selected log definition is drawn as a series. Series are of the column (
bar) type by default; the series type can be changed in the Chart Settings window. - The series name is the description of the log definition followed by the tag's unit in square brackets.
- Each series has a dashed mark line that shows the average of the series.
- The Query interval button on the toolbar sets the date range backwards from now to between 1 and 24 hours; Auto refresh interval makes the data refresh by itself.
In the table view, the leftmost column contains the start time of the period, and the following columns contain the period consumptions of the log definitions. The summary rows below the table show the minimum, maximum, average and total values and the Diff for each column:
- The Total row is the total consumption in the selected range.
- Diff is the difference between the consumption of the last and the first period; it is not the total consumption.
Exporting
- Export > Export to PDF: Downloads the chart and the table as a PDF file.
- Export > Export to Excel: Writes the report details and the table to an Excel file, and the chart image to the Chart sheet in the same file. The file name consists of the report name and the current date.
- Save as image: Downloads the chart as a PNG image.
The Export button is disabled until the first query is run.
Query limits
Limits are applied to queries to protect the server. The limits come from the server settings:
- 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 and the query is not run.
- If the selected range, the number of log definitions and the consumption period produce too many periods, the period is increased automatically and the The sampling interval was increased to {seconds} seconds to keep the service safe. warning appears. In this case the periods no longer match hour, day or month boundaries; narrow the date range or select a longer period.
If the consumption period is shorter than the record interval of the log definitions or there are too many records in the range, suggestion windows may open as in Trend Analysis (see Filters).