Making multiple queries on the same panel with the help of template variables

Hello everyone,

I am very fond of templating feature on grafana and i use it extensively. The current way i am using it is by adding the variable name like $var in my sql or psql query and along with that replicating the panel by repeating the panel with the same variable. (Genearl - Repeat - For each value of). So by selecting multiple values of that $var, it creates that many panels.

But i want to use it in this way that whenever i select multiple values of $var, instead of creating multiple panels, it should create multiple queries by just replacing the value. Either by creating a new query say ‘B’ inside the panel itself.
I am new here, so does a way to do that on psql and sql queries exists already because i want to achieve that on my graph panel where i can plot the values and trend for two days on the same graph itself.


Did you find any solution? i am also looking something similar.