Hello,
I’m new to Grafana, but already have some nice dashboards running.
- Grafana is running in docker at a Synology
- my database is mariasql, works fine
- Database has a lot of tables, all have a timestamp ‘Time’ and a float value ‘Value’ as data.
- my panel is a simple bar gauge.
One bar1 is filled this way :
SELECT SUM(Value) / 60000 AS ‘Bad’
FROM
openhab.Item98
WHERE
$__timeFilter(Time);
This works fine.
Another bar2 shall be filled this way :
SELECT SUM(Value)
FROM openhab.Item106
WHERE $__timeFilter(Time) INTO @a;
SELECT SUM(Value)
FROM openhab.Item107
WHERE $__timeFilter(Time) INTO @b;
SELECT @a+@b AS ‘FL’;
The query runs as SQL command line at my server or in a windows-client as well.
I expected that bar2 would show the sum of the two SQL variables a and b set by the two queries ?
What’s my mistake ??
The reason for this is that I have a database with some large values and a lot of tables with small values, and I want to summarize the small values to one bar.
Thx for any hint to get smarter .