fantastic job with this application, it is getting better a better by the day. I would like to display in the same graph this month and last year month. I was thinking to create two queries, Query A for this month and query B for last year month. Unfortunately I’m having issues with last year month. The query should be based on the ranges that I select and subtract by a a year. The first query “A” I have is something like this, how do a create another query “B” to dispay last year data?
UNIX_TIMESTAMP(datecreated) as time_sec,
max(devicevalue) as value,
‘KWH’ as metric
WHERE $__timeFilter(datecreated) and deviceroom = ‘Energy Monitor’ and devicename = ‘Total KW Hours’
group by HOUR(datecreated)