Change value from query result using rename by regex

  • What Grafana version and what operating system are you using?
    v8.5.0 (6134e3cf35)

  • What are you trying to achieve?
    I wanted to create a pie chart from a table that show some calculation some rates. I want to categorize these values into some text. For example,
    range: 1 - 0.5 → healthy
    range: 0.5 - 0.3 → bitsick
    range: 0.3 - 0 → sick

    Then from this data I want to show the pie chart to count of every healthiness category, e.g healthy=3, bitsick=2, sick=1

  • How are you trying to achieve it?
    These result is coming from 2 different data source, so I can only use transform to calculate or process between the 2 table. Once I got the value category, I want to use rows to field transform to calculate the count of each category.

  • What happened?
    There’s no transform feature that can map the value into some category, so I can’t show whether the value is on some category that I want to range. I try to use the rename by regex, but no clues.