Multiple Graph multiple Queries , in One panel PostgreSQL data source

  • What Grafana version and what operating system are you using?

  • What are you trying to achieve?
    i want to creat a panel with all Variable i defined.

  • How are you trying to achieve it?

Variable name = LH
SELECT DISTINCT"TE_ID" FROM public." Daten"

Preview of Values
all 1 2 3 4 5 6 7 8 9 10

Panel
SELECT “SOC” AS “value”, “Zeit” AS “time” FROM “Daten” WHERE"TE_ID"= $LH

  • What happened?
    if i select
    one Variable it Worke Properly
    more then one Variable : db query error: pq: syntax error at or near “,”
    All Variable: db query error: pq: syntax error at or near “,”

  • What did you expect to happen?

i’m expeding to be abble to see all Variable in one Panel,
10 diferent graph in one Panel with label 1 to 10.

  • Can you copy/paste the configuration(s) that you are having problems with?

SELECT “SOC” AS “value”, “Zeit” AS “time” FROM “TE_Daten_Allgemein” WHERE"TE_ID"= $LH

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.

db query error: pq: syntax error at or near “,”

  • Did you follow any online instructions? If so, what is the URL?

PostgreSQL data source | Grafana documentation

where TE_ID in (${LH});

as you cant have

WHERE TE_ID = 1,2,3,4,5,6,7,8,9,10

thank you very much the Solution

where TE_ID in (${LH});
but is just showing the Overage value of all 10 Variable and

i want to be able to combine in one panel the result of all LH
LH= 1+2+3+4+5+6+7+8+9+10

SELECT “SOC” AS “value”, “Zeit” AS “time” FROM “TE_Daten_Allgemein” WHERE “TE_ID” in (${LH}) and $__timeFilter(“Zeit”)

Result have been limited to 1000000 beacause the SQL row limit has reached.

so i used the time Filter

SELECT “SOC” AS “value”, “Zeit” AS “time” FROM “TE_Daten_Allgemein” WHERE “TE_ID” in (${LH}) and $__timeFilter(“Zeit”)

1 Like

oh sorry! :slight_smile:
here is how you would do it

just add new row then select the value you want to use to repeat paners. just leave the query like it was

SELECT “SOC” AS “value”, “Zeit” AS “time” FROM “Daten” WHERE"TE_ID"= $LH

Then select the gear

image

when you click that gear this shows up to help guide you to select the column to repeat panels on

image

thank you @yosiasz

is it possible to have something like This by selecting all Variable buy using just one Querry?
i did this one with Influx DB

you are very slippery. what is x axis value?

in my case

the X Axis ist the “SOC” and the Y Axis is the “time”.
and 10 LH.

SELECT “SOC” AS “value”, “Zeit” AS “time” FROM “Daten” WHERE"TE_ID"= $LH

you mean the other way around? X axis is time, Y is value?

sorry. yes exatly.
X axis is time, Y is value.

LH is the number of the Hause, that mean i have 10 Hause

wow i nerver thougth about that.

why does my column not automaticly recognise
I can neither select LH nor write manually.

Cause you are missing the metric column TE_ID in your query