I think I need help sorting?

Hi,

I am aggregating license plate activity and wish to display that data in various forms. I have both InfluxDB 2.7.1 and Grafana 10.0.3 installed on a Windows machine.

I have a nice doughnut/pie graph showing license plates added and grouped to show the states most seen.

I thought I had it down but then I noticed that the ‘Top 10’ I am trying to display isn’t actually showing the top most seen states, it seems to just be showing the states in order; alphabetically order, I think. Wisconsin should be the highest and if I include all states, it is the highest.

I think I need to sort by the _field? I am not sure how to do that or what query I need. What I keep trying isn’t working.


This seems like it should work but it isn’t: Sort and limit data in InfluxDB with Flux | InfluxDB Cloud (TSM) Documentation

I have a bad feeling that the sort function doesn’t work because each state has it’s own table. The sort function won’t sort tables just data within tables.

I am guessing there might still be a way to do this or maybe I need to look at how the data is originally parsed coming into Influx. Either way, I am not sure I am motivated enough to beat my head against the wall much longer.

In Influx Data Explorer, what happens to the data (in table form) when you remove the group() function?

PS: I am confident you can get this working!