Another named query question from me.
Here’s the query I’m talking about:
DECLARE @downtimeDivisor AS INT = 1
IF :downtimeFormat = 'hours'
SET @downtimeDivisor = 3600;
ELSE IF :downtimeFormat = 'minutes'
SET @downtimeDivisor = 60;
SELECT TOP(:limit)
stops.first_fault AS fault,
COUNT(*) AS count,
(SUM(stops.stop_duration) / @downtimeDivisor) AS downtime
FROM stop_history stops
WHERE stops.first_fault_time BETWEEN :startDate AND :endDate
AND stops.first_fault NOT IN {hiddenFaults}
GROUP BY stops.first_fault
ORDER BY count DESC
My situation is this:
- A view is showing an XY chart whose data are from this Named Query.
- The
downtimeFormat
parameter of this Named Query comes from a tag whose value can be changed via a dropdown in another view that is a popup. - If I change this dropdown from
hours
tominutes
orseconds
, the XY chart updates properly. - If I change the dropdown from its current value to one that gives a smaller number (that is, from seconds to minutes, seconds to hours, minutes to hours) the XY chart does not update properly. The data refreshes, but it shows the values related to the previous dropdown selection. The XY chart’s Y-axis is also based on this
downtimeFormat
tag, and they are properly updating.
This behavior is inconsistent. Sometimes the data updates as expected, sometimes it doesn’t.
I have tried everything related to disabling caching, but I cant seem to find a way to forcibly refresh this property’s Query binding from the tag changed event, or from the dropdown change since it’s in another view.
Is there something I’m missing? I’m really not sure what is going wrong and how to get this chart data to update properly.
EDIT: Just tested to be sure, and the same behavior happens no matter if the dropdown is in the same view as the XY chart or in a different one.