Search Results prev_net_reading




Overview

OKX_COUNTER_VALUES_V is a reporting and integration view owned by the APPS schema within the OKX – Contracts Integration product of Oracle E-Business Suite. It exposes the historical readings of counters, providing a flattened, query-friendly representation of counter measurement data captured against contracts and related service points. The view is documented as VALID and carries a description of "Historical readings of counters," indicating its purpose as a read-only projection rather than a transactional entity.

The view is particularly relevant to users and integrators who search for the PREV_NET_READING attribute, which appears as a native column in the view's projection. This column supports comparison of a current net reading against its immediate predecessor, enabling consumption, usage, and delta calculations that are central to metered contract billing. Because OKX is the Contracts Integration module, the view frequently serves as a bridge between operational counter capture and downstream contract rating, pricing, and usage-based invoicing processes.

Underlying Base Objects

The view text selects all its columns from a single source object, CS_COUNTER_VALUES, aliased as CV. Within the EBS 12.1.1 / 12.2.2 environment, CS_COUNTER_VALUES is referenced through a synonym that resolves to the actual counter values base table. The documented referenced base objects for the view are CSI_COUNTER_READINGS_PVT (a PL/SQL package) and CS_COUNTER_VALUES (synonym).

The relationship to CSI_COUNTER_READINGS_PVT reflects the fact that counter readings in the CSI/CS schema family are typically written and maintained through this packaged API. The view therefore presents persisted results of reading capture performed by that package, rather than generating new logic of its own. Two columns in the projection — SEQ_NO and PREV_NET_CURR_DIFF — are returned as TO_NUMBER(NULL), meaning the view intentionally surfaces these as placeholders with no stored value, consistent with a simplified historical projection.

Key Columns

  • COUNTER_VALUE_ID — Primary identifier for each counter value record.
  • COUNTER_GRP_LOG_ID — Links the reading to its counter group log, grouping related readings.
  • COUNTER_ID — Identifies the specific counter being measured.
  • VALUE_TIMESTAMP — The date and time at which the reading was taken.
  • SEQ_NO — Exposed as NULL in this view; sequence assignment is not persisted here.
  • COUNTER_READING — The raw counter reading as captured.
  • RESET_FLAG and RESET_REASON — Indicate that a counter was reset and the reason for the reset.
  • PRE_RESET_LAST_RDG / POST_RESET_FIRST_RDG — Readings straddling a reset, used to reconcile usage across resets.
  • MISC_READING_TYPE and MISC_READING — Supplementary reading categories and values.
  • PREV_NET_CURR_DIFF — Exposed as NULL; the net difference is not stored in this projection.
  • NET_READING — The net counter reading, typically adjusted for rollovers or resets.
  • PREV_NET_READING — The previous net reading, which is the attribute most commonly queried for period-over-period comparison.

Common Use Cases and Queries

Typical scenarios include retrieving the reading history for a given counter within a time range, detecting resets, and computing usage as the difference between NET_READING and PREV_NET_READING. A representative query is:

SELECT counter_id, value_timestamp, net_reading, prev_net_reading,
       (net_reading - prev_net_reading) AS usage
FROM   apps.okx_counter_values_v
WHERE  counter_id = :p_counter_id
ORDER  BY value_timestamp;

For reset analysis, filtering on RESET_FLAG = 'Y' and examining PRE_RESET_LAST_RDG and POST_RESET_FIRST_RDG clarifies whether a gap in usage reflects a genuine reset. Because SEQ_NO and PREV_NET_CURR_DIFF are NULL, usage calculations should rely on PREV_NET_READING rather than the placeholder columns.