How can i sort fields from the same measurement

Hi community, I’m noob in this Grafana thing so excuse me if its too easy what I’m trying to do,
Basically I’m running on the Open-Source Version of Grafana v8.5.2

I’m querying Data from InfluxDB and displaying it as a Bar Gauge Chart, what I’m trying to do is to SORT the fields based on their data. Each one of the fields is a measurement of current in Motors, so I want to show the field name of the motor with the greater current consumption.
This is the Chart right now.


Might this transformation work for you?

No, it doesnt work, thank you for the reply.

here a pic of what it says on the sort by transformation.

1 Like

What is the _value column name in the Table View section

this is what I see on the table view

1 Like

What happens if you add this

|> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value")
  |> group()  
  |> drop(columns: ["_start", "_stop", "_measurement","type"])

Hey, it gets the graphics like this

And how does transformation look like, can you now see the column name to sort by? What does the table view look like

No, after adding what you sent me i can now see the same fields but now it added a ‘DATA_TBG’ behind every name.

I’ve successfully completed the task by adding this 2 transformations.
The first one reduces de series data to the last value received.
that gives me 2 columns, FIELD NAME and VALUE, field name is the name of each one of my motors and then value has the last value received so I can sort fields based on value.

Anyways, thank you for your help, Now I see that I have to learn how to use al those transformations.

1 Like