Hi, I can’t seem to figure out why I get this error - “Cannot read property ‘valueOf’ of undefined”
It was running fine just a few days ago.
StackTrace
SQL Query used
SELECT float_val as value, UNIX_TIMESTAMP(smpl_time) as time_sec, name as metric
FROM archive.sample AS a
Join archive.channel AS b
ON a.channel_id = b.channel_id
WHERE name LIKE “%uamp%”
ORDER BY smpl_time ASC
LIMIT 1000;
This query works in MySQL Workbench
Any help is appreciated!
Hi,
I think this may be related to returning a column of decimal type. Try and cast float_val to signed integer using
SELECT float_val DIV 1 as value
...
If you have nergative values, please use other cast than DIV 1.
If you want to plot the result in a graph panel you should add GROUP BY clause for date and metric column like
``'sql
WHERE …
GROUP BY 2, 3
Marcus
Hi,
I’ll give those a try and update you on progress.
Thanks,
Aidan
1 Like
I was working on other projects for a few days, and when I came back to working with Grafana, it seems to be working. My thought is that it may be a change to the Database which allowed it to work.
I still may add/modify my query to make it more robust.
Thanks,
Aidan
1 Like