0

I'm using Grafana v9.3.2.2 on Azure Grafana

I have a line chart with labels of an ID. I also have an SQL table in which the IDs are mapped to simple strings. I want to alias the IDs in the label to the strings from the SQL

I am trying to look for a transformation to do the conversion.

There is a transformation called “rename by regex”, but that will require me to hardcode for each case. Is there something similar with which I don't have to hardcode for each case.

There is something similar for variables - https://grafana.com/blog/2019/07/17/ask-us-anything-how-to-alias-dashboard-variables-in-grafana-in-sql/. But I don't see anything for transformations.

Shobhit Kumar
  • 626
  • 1
  • 5
  • 21

1 Answers1

0

Use 2 queries in the panel - one for data with IDs and seconds one for mapping ID to string. Then add transformation Outer join and use that field ID to join queries results into one result.

You may need to use also Organize fields transformation to rename, hide unwanted fields, so only right fields will be used in the label at the end.

Jan Garaj
  • 25,598
  • 3
  • 38
  • 59