Hi all,
Currently learning the Reporting module of Ignition as I am in the process of converting our old Excel based reports to Ignition (automation woohoo!). I am having difficulty in replicating some relatively simple pie charts and/or graphs, specifically with regards to using database-queried data to drive these charts.
I am storing our shift production counts in a MySQL database, hopefully following all the wonderful suggestions I received in my other thread. I have written a named query which will return the max value (or in other words, the current shift total) of 3 separate tags stored in the DB. The query limits the search to the previous shift time using the tstamp, and is searching for the tagid as provided in the actual report query.
select tagid, sqlt_data_1_2023_02.intvalue
from sqlt_data_1_2023_02
where (sqlt_data_1_2023_02.tagid = :TagID1 OR sqlt_data_1_2023_02.tagid = :TagID2 OR sqlt_data_1_2023_02.tagid = :TagID3) AND sqlt_data_1_2023_02.t_stamp BETWEEN :StartOfShift AND :EndOfShift AND (tagid, sqlt_data_1_2023_02.intvalue) in
(select tagid, max(sqlt_data_1_2023_02.intvalue)
from sqlt_data_1_2023_02 group by tagid)
When I run the query manually either in Designer or in MySQL, I receive the following data (this is what I wanted when I wrote the function):
tagid | intvalue |
---|---|
10 | 29265 |
23 | 225 |
33 | 4356 |
Where I'm having trouble is in getting this data to show up (in literally any way, I've tried several charts, tables, etc.). As I said before, the query returned the data as I wanted it to, but perhaps that was misguided from the start. Do I need to have it return the data in some other way?
Advice is appreciated, thanks in advance!