Explainer
OPC UA Historian 2 aggregate configuration and DurationGood
Short answer
For all OPC UA Historian 2 sample calculations, use UseSlopedExtrapolation=False, Stepped=False, TreatUncertainAsBad=True, PercentBad=100 and PercentGood=100. DurationGood counts only time with Good status, so extrapolation flags cannot change its 7001 ms result, and sloped extrapolation of the 80 and 90 samples gives 105 at 12:01:36, not a DurationGood value of 13001.
On this page
- Which aggregate settings does OPC UA Historian 2 use?
- Why does the aggregate test utility disagree with the document?
- Why doesn't extrapolation change the DurationGood result?
- How is the sloped extrapolated value at 12:01:36 calculated?
- What quality does the extrapolated value carry?
- How do PercentBad and PercentGood set the interval quality?
- What result should you accept for the 12:01:20 to 12:01:36 interval?
- Questions asked
For every OPC UA Historian 2 aggregate sample calculation, set UseSlopedExtrapolation=False, Stepped=False, TreatUncertainAsBad=True, PercentBad=100 and PercentGood=100. That is the reference configuration the aggregate document fixes for Historian 2, and any tool that differs on even one flag will disagree with the published results for reasons that have nothing to do with your data.
Which aggregate settings does OPC UA Historian 2 use? #
The Historian 2 reference configuration is five values: UseSlopedExtrapolation=False, Stepped=False, TreatUncertainAsBad=True, PercentBad=100, and PercentGood=100. The aggregate specifications in OPC UA Part 13 define the calculations; these five settings are the fixed inputs the Historian 2 worked examples assume.
Each flag does one job:
TreatUncertainAsBad=Truemeans an Uncertain value is treated as Bad and excluded from the aggregate.Stepped=Falsemeans sloped interpolation is used between data points inside the interval.UseSlopedExtrapolation=Falsemeans stepped extrapolation is used at end boundary conditions.PercentBad=100means the interval quality becomes Bad only when all values are Bad.PercentGood=100means the interval quality is Good only when all values are Good; a mix of Good and Bad produces Uncertain.
The settings live in the aggregate configuration your client sends with the historical read or that the server exposes as its default processing options. If your aggregate tester has a profile per reference historian, select the Historian 2 profile instead of editing flags by hand.
Why does the aggregate test utility disagree with the document? #
The discrepancy in this case is one flag: the test utility ran UseSlopedExtrapolation=True while the Historian 2 document fixes it to False. The utility's next update sets it to False for Historian 2, so treat a current mismatch on this flag as a known tool deviation, not as a contradiction between the standard and the document.
This matters because a reader comparing their own server against the Historian 2 example output must first align all five flags. An aggregate result computed with the wrong extrapolation flag will not reproduce the example even when the server is perfectly correct.
Why doesn't extrapolation change the DurationGood result? #
DurationGood is unaffected by extrapolation mode because it measures only the time, in milliseconds, that the value's status was Good, and UseSlopedExtrapolation changes how numeric values are extended, never what status the raw samples carry. The aggregate definition reads status only, so stepped or sloped extrapolation cannot move the number.
For the interval 12:01:20 through 12:01:36, the documented output is 7001 with Good, Calculated, Partial status. A proposed result of 13001 was derived by assuming that a sloped extrapolation of two Good samples extends Good status to the end boundary, and that assumption is wrong: DurationGood counts Good time from actual sample status, not from extrapolated values. The interval is 16000 ms long; only 7001 ms of it is Good under the reference configuration.
How is the sloped extrapolated value at 12:01:36 calculated? #
With sloped extrapolation, the value at the end boundary is the last value plus the slope between the last two points multiplied by the time from the last point to the boundary. The formula is V2 + (V2 − V1) / (T2 − T1) × (Te − T2), where V2 and T2 are the latest sample's value and timestamp and Te is the requested end boundary.
Worked example with the Historian 2 data points that matter:
- V1 = 80 at T1 = 12:01:26 (4000 ms before T2)
- V2 = 90 at T2 = 12:01:30
- Te = 12:01:36, which is 6000 ms after T2
- Slope = (90 − 80) / 4000 ms = 0.0025 per ms
- Extrapolated value = 90 + 0.0025 × 6000 ms = 90 + 15 = 105
So sloped extrapolation gives 105 at 12:01:36. That is a numeric value, not a DurationGood result, and it does not make the 13001 figure correct under any reading.
What quality does the extrapolated value carry? #
With the reference settings the extrapolation is stepped, and the boundary timestamp at 12:01:36 reports BadNoData because there is no later raw entry to extend. The evidence in the sample calculation does not establish what status a sloped extrapolation built from two Good points would carry; read the quality for that case from the specific aggregate definition in OPC UA Part 13 rather than inferring it from the two Good source points.
The practical consequence is simple: an extrapolated number is a calculated artifact. Never let it silently upgrade the quality of a time-based aggregate such as DurationGood.
How do PercentBad and PercentGood set the interval quality? #
With both set to 100, the interval is Good only if every contributing value is Good, Bad only if every contributing value is Bad, and Uncertain for any mix. Combined with TreatUncertainAsBad=True, the Uncertain raw sample at 12:01:17 counts as Bad, which is why the interval status comes out as a calculated value with Partial indication rather than an unqualified Good.
If you relax PercentGood below 100, an interval containing a mix of Good and Bad can report Good, which changes the DurationGood result directly. That is a legitimate configuration choice for some sites, but it no longer matches the Historian 2 reference and any comparison against the documented outputs becomes invalid. For more on how these percentage thresholds play out in other status-driven aggregates, see the guide on interpreting TreatUncertainAsBad results in the Count aggregate and the guide on resolving %Good and %Bad results above 100.
What result should you accept for the 12:01:20 to 12:01:36 interval? #
Accept 7001 milliseconds with Good, Calculated, Partial status for DurationGood, and BadNoData at the 12:01:36 boundary. Set the five reference flags exactly as documented, compute numeric aggregates and status-based aggregates separately, and never let an extrapolated numeric value change a time-based result.
If your historian or client still disagrees after the flags are aligned, check the raw data first: confirm the Uncertain sample at 12:01:17, the three Good samples at 12:01:23, 12:01:26 and 12:01:30, and the absence of any later entry. Only after the input and the flags are both confirmed should you question the server's aggregate engine. How stored samples reach the server in the first place, and when buffered data counts as stored, is covered in the article on verifying historian store-and-forward completion.
One safety note: aggregate configuration errors are reporting errors, not control errors. Never use a historian-calculated DurationGood or extrapolated value as an input to an interlock or safety function; those functions belong in the control system's safety layer, validated independently of historical data processing.
Questions asked
Which aggregate should you use instead to see the extrapolated numeric value?
DurationGood is a time-based aggregate and only reads status, so it never exposes the extrapolated number. If you want the numeric value carried to the interval boundary, request a value-type aggregate such as an end-of-interval or average aggregate, and read its quality from the aggregate definition rather than from the two source points.
What does the BadNoData at the end boundary mean?
With UseSlopedExtrapolation=False, the server applies stepped extrapolation at end boundaries and, when no raw sample exists to extend, the boundary timestamp carries BadNoData. That status belongs to the 12:01:36 boundary point itself; it does not retroactively make the interval's DurationGood result wrong, because that result already counted only the 7001 ms of Good status inside the interval.
Does the same configuration apply to other OPC UA test historians?
The five values are specific to Historian 2, the reference data set the OPC Foundation uses for its Part 13 aggregate sample calculations. Other reference historians in the same test suite use different flags deliberately, so a mismatch against another historian's numbers is not evidence that your configuration is wrong; compare against the table published for that historian.
How do you verify your own server against these results?
Feed the Historian 2 raw data set into your client or a test utility with the five reference settings, then check both the numeric results and the status codes separately against the published values. A server that returns the right number with the wrong status is still misconfigured, and most aggregate validators treat a status mismatch as a failure.