I’m using
Ubuntu 22
MySQL 8
Grafana Grafana v10.2.0
I have already connected my panel to MySql and it is working, to query statics.
However, I’ve tried changing the SQL queries so that they respond to Grafane’s data filter, I can’t.
I expected that when selecting a date in the date filter, my Dashboard would respond to the filter and update the query and this is not happening.
I need support for this, I’ve already researched a lot and even read the forum, but I couldn’t get anywhere.
SELECT
DISTINCT
REPLACE(T_BASE.ds_client, 'grp-sandbox-', '') AS Cliente,
DT_CREATED_AT AS UltimaUtilizacao,
ABS(TIMESTAMPDIFF(MONTH, CURDATE(), DT_CREATED_AT)) AS Tempo_meses
FROM T_BASE
LEFT JOIN (
SELECT DS_CLIENT
FROM T_BASE
WHERE DT_CREATED_AT >= DATE_SUB(CURDATE(), INTERVAL 30 DAY)
GROUP BY DS_CLIENT
) Recentes ON T_BASE.DS_CLIENT = Recentes.DS_CLIENT
WHERE Recentes.DS_CLIENT IS NULL
GROUP BY T_BASE.DS_CLIENT;