I have a dataset on a sparkline populated by a tag history binding. I’ve used min() and max() expressions to get the min and max value. I’d like to do the same to get the start and end date from the dataset, but the same expression isn’t quite working on the t_stamp column.
For instance, max (works):
max({Root Container.Sparkline Chart.data},1)
End date (doesn’t work):
max({Root Container.Sparkline Chart.data},0)
How can I get the start and end date from the sparkline dataset?
You cannot get it from the dataset, as history results don't guarantee that result timestamps fall exactly on the start and end boundary. For any aggregate, the last timestamp will be one interval short of the boundary.
You have to be feeding the history binding a date range, so you should simply use that.
It’s just any other dataset at this point with a t_stamp and a value column. There should be a way to get a numeric representation of the t_stamp value and find the min/max, right?