Expected return format for MinMax aggregate using a Custom History Provider?

I am trying to implement a Custom History Provider. I cannot get the correct values (1 for each) to return in MinMax when displaying the data to a chart or a table.

Expected: (using SQL Lite historian)

Actual: (My History Provider)

Code:
Essentially what I am doing is adding the Minimum aggregate then the Maximum aggregate to the history column

        for (var entrySet : tagConfigByTagId.entrySet()){
            var values = valuesByTag.get(entrySet.getKey());
            if (values != null){
                var tagConfig = entrySet.getValue();
                var column = columnNodesByName.get(tagConfig.getPath().toStringFull());
                if (column instanceof ProcessedHistoryColumn){
                    List<QualifiedValue> qualifiedValues = new ArrayList<>();
                    for (var aggregateValues : values.getAggregates().values()){
                        for (var value : aggregateValues.getValues()){
                            qualifiedValues.add(new BasicQualifiedValue(value.getValue(), QualityCode.getQualityFor(value.getOpcQuality()), Utility.FormatAsLocalDate(value.getUtcTimestamp())));
                        }
                    }
                    ((ProcessedHistoryColumn)column).put(qualifiedValues);
                }
            }
        }

Your time span is 7 hours different?

This is just an example to demonstrate what I am looking for. I'd expect to see 2 values (1 for min, 1 for max) for each timestamp. The actual timestamp and the value are irrelevant in this case.

It does matter. Min/Max only returns a single row if it didnt change in the time span. Probably not your issue, but apples to apples data comparison might help identify a problem.

I understand that for the SQL Lite historian. This does not apply to my historian which will return a value for the interval regardless of if there is data or not. I'm pretty sure that the issue is with how I am adding the data to the column in HistoryQueryExecutor.

1 Like