Is it possible to order the columns in a Grafana Table?
I have a Table (sourced from InfluxDB) but the columns are in a «wrong» order... I tried changing the order of the Group By clause in the InfluxQL but I get the exact same results.
When you edit a table view, Just next to Query tab (below the table), there is Transfer tab. You can :
If you explicitly list the columns you want from InfluxDB they will be in that order in the table. If you use select * you don't have control.
The time column always comes back from InfluxDB as the first column. There is nothing you can do to control that (for now).
You can hide the column using a column style of hidden.
If you meant rows instead of columns, ask a new question.
Using "Edit" option in your table, you can select "Transform" (arrow#1) and then hide a column by using the "eye" icon (arrow#2) and reorder table columns by grabbing the rectangular icon at each column (arrow#3) and move it up/down. Find those arrows in the image here:
Column reordering is available since Grafana 7.0 via organize fields transformation.
Was looking for the same and found a solution. So, when you use the built-in query and select '*' in field(value) it gives you all columns and as influxDB table columns (it will be returned in alphabetical order). But, I wanted my order to be different so I wrote a query which consisted of all the column tab names mentioned, separated by commas.
So within the table panel - Metrics -> Click on button next to view symbol and choose (Edit Toggle mode) and enter your query. The query should look something like this -
SELECT "field_1","field_2","field_3","field_4" FROM "autogen"."measurement_name" WHERE $timeFilter
you can probably write a script to help you create these scripts when you are entering data into your influxdb series.
OK, So... this is a very hacky solution, but you can make multiple queries to get the results in the order you want.
Say you want want the order to be "field_2","field_3","field_1","field_4"
Query A can be SELECT "field_2","field_3" FROM "autogen"."measurement_name" WHERE $timeFilter
Query B can be SELECT "field_1","field_4" FROM "autogen"."measurement_name" WHERE $timeFilter
This works with prometheus, I have not tried with influx... but i don't see why it wouldnt work the same.