Urgent help: Is it possible to build a query on top of another query?

Hi all,
I want to find the max of is_stale_or_missing per pipeline and then aggregate that per service. I am not sure if it is even possible to do both of these things simultaneously. I tried but could not find a way to do it.

I would really appreciate some guidance on this. For reference, I have attached a screenshot.

You should be able to accomplish this using Transformations.

Hello @woot365 ,
Thanks for the suggestion!
I tried it using transform but I am new to Grafana so I might not be doing it the way you are suggesting. I was wondering if you could provide step by step explanation.

I would really appreciate the help.


Hello @woot365,
So I tried getting max as the metric in the query per pipeline and then I applied the transform, “Add field from calculation” to get the aggregate of max using average but I am unable to aggregate per service through transform.

I have attached the screenshots for reference. Any guidance would be really appreciated.