How to fix last query alias

I have a number of queries, their names are linked back to variables in settings. I need to show all of the queries in a panel.

One hidden query is the total input of energy into the monitored equipement.

I then have an expression set up, subtracting all monitored sub components from the total input to give a representation of the unmonitored components.

Expression is as follows: $P-$A-$B-$C-$D-$E-$F-$G-$H-$I-$J-$K-$L

I commonly use this formula with no issues. This time, however, the alias of the last query (L) is showing up as part of the name of the expression ie: Unmonitored load alias of L.

I want my expression to show up just as “unmonitored load” in order to avoid confusion.

Can anyone assist? I don’t want to post screenshots or exact details for confidentiality reasons.

Grafana can end up using the metadata/field name from one of the referenced queries when displaying an expression. You don’t need to change the expression itself.

A field override can be used to explicitly set the display name of the expression:

Panel settings → Overrides → Add field override
Matcher: Fields returned by query
Select the Math expression’s RefID (M in your example), not $L.
Add override property → Standard options → Display name
Set it to Unmonitored load

Your expression can remain:

$A-$B-$C-$D-$E-$F-$G-$H-$I-$J-$K-$L

I tested this with a 12 query setup and the expression’s displayed name changed to Unmonitored load while the expression itself remained unchanged.

This should therefore let you keep all the existing query aliases while giving the expression a fixed display name.

If Fields returned by query doesn’t expose the expression in your Grafana version, you can instead use Fields with name matching regex and target the generated field name.


Great! thats sorted it, thanks.