How can I change the order of columns in the table panel with flux and grafana 10

I’m using Grafana 10. I’m creating a table with the data I pull from InfluxDB 2.7. I’m fetching this data with the following code using the FLUX language. How can I change the order of columns in the table? In InfluxDB 1.8, I was able to do this by directly changing the order of column names within the query. I couldn’t do this with FLUX. Everytime i renew the table panel the column name orders are changing.

from(bucket: "Vbucket")
  |> range(start: -30d)
  |> filter(fn: (r) => r["_measurement"] == "VMwareRawData10")
  |> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value")
  |> keep(columns: ["_time", "Client", "Policy", "Start_Time", "End_Time", "Policy_type", "Master_Server_Name", "Schedule_Type", "Job_Status", "Job_Status_Code", "Duration_Minutes", "Written_Size_GB", "real_Size_GB", "throughput_MB_per_sec"])

Hey @ivbtar ,

I think you can achieve what you want using transformations. I think the Organize fields by name can do what you want.
Let me know if it worked :slightly_smiling_face:!

Regards

2 Likes

Yes @codi639 , it worked. Thanks alot.