Jam event counts using tag history

I am recording a boolean tag that is high whenever a jam event occurs for a specific location. In a bar chart object in Vision I can select the data from tag history and when using aggregate mode closest value I can see every 0-1 and 1-0 transition:

image

I’m trying to look at the number of events in some period, for testing using real time last 1 day of data. My first thought was to use aggregate data “Count On” but selecting this does not change my data dataset at all. I’d like to have one bar with the count, once that is working more sensors will be added.

Must be missing something here, it looks like it’s trying to graph over time instead of grouped by tag. I tried setting Extract Order to column, which I think would work if I could get one row of aggregate counts, instead of my data still showing period 0 and 1 instead of the count.

You need to set sample size to interval and then set the appropriate interval.

Thanks, this is what I was missing. Since I only ever want one data point per tag (the total count for the time range), I actually used fixed and set it to 1.

The chart is now mostly how I want it, but I’d like to sort the columns of my dataset so that the bars are listed in descending order (like the Pareto option in the report version of the bar chart does) and also limit to say the top 10 by count value.

I’m hoping there is an easier way, but I think I can add scripting to transpose my 1R x 18C dataset to be 18R x 1C and then use the sort expression/script function on the column. From there it would be easy to remove the rest of the data past the top 10 rows, then transpose it back.