How to stack two query values onto one graph

  • What Grafana version and what operating system are you using?
    I am using managed Grafana in the cloud.
  • What are you trying to achieve?
    I am having two queries that are showing two different values in one time-series graph. Data source is influx db. I can not get sum in influx, because measurements are not done in completely the same _time (in the same second)
  • How are you trying to achieve it?
    I already tried to create new query and use $A+$B, but without success.

In the above screen, you will see, I have a value of 3 and value of 18, I would also like to have a line with value 21, that will represent the sum. How is this possible?

I solved the problem. Created new query C: $A+$B as described above. Before I was having problem with initial queries, after modifying it, it started working.

1 Like

Hi,
Can you share steps, i have the same problem. I have two queries A and B, and want to graph and sum.
I tried adding expression $A+$B but not working.

you have 2 queries with 3 fields each. so summing them $A + $B is going to be a problem

I solved it by summing the two graphs using transformation.

Iā€™m still interested to know how can i use expressions to add each field in a graph to its corresponding one in another graph.