Trying to get topN from results

Grafana: v10.0.3, OS: Win10

What am I trying to achieve:
Would like to take the results I have, and select only the topN of a ‘counts’ field

How am I trying to achieve it:

  • My input comes from Telegraf: SNMP trap collection from a Cisco WLC (specifically client registrations).
  • I have limited the traps and fields in Telegraf
  • I output the processed input into Influxdb under the measurement snmp_traps
  • Only three fields are stored: AP_Name, Client_IP and WLAN.
  • I created a panel in Grafana that does three queries: One for AP_Name, One for Client_IP and finally WLAN
  • I setup four transformations (in order):
  • Outer join by time
  • Out join by WLAN
  • Group by AP Name and then calculate Client_IP count
  • Rename Client_IP (count) to Client_Count

What happened:
The table displays as expected (from my test data, I see 11 APs with client counts for each based on the time range selected), but I can’t figure out how to limit the results to just the top 4

What did you expect to happen
N/A - Looking for a solution