What's the best way to pivot data

  • What Grafana version and what operating system are you using?
    8.2.6 in a Debian/Docker

  • What are you trying to achieve?
    I am very new in Grafana. My first day today. I have a table structered as following

ColA ColB ColC
A E 1
A F 2
A E 3
B F 4
B E 5
B F 6

I’d like to aggregate ColC grouped by ColA in Rows and ColB in Columns.
E F
A 4 2
B 5 10

The data are currently stored in a sqlitedb. What’s the best way to achive this usecase?

welcome to the :grafana: forum, @steff123

It sounds like it would be best to filter / reduce / pivot / or otherwise transform the data on the DB side by adjusting your SQL query. But, you should also check out using Grafana’s built-in transformations, which can do a lot of powerful sql-like transforms. Just remember that all those get done on the frontend side so they are not nearly as performant :+1:

1 Like