I have two totalized flows. At midnight a Gateway Event script stores the now previous day’s total in the MySQL historical database. It is stored with:
system.tag.storeTagHistory(histProv,tagProv,paths,values,quals,t_stamp)
t_stamp is set to noon of the day. I’m attempting to create a report with a table and graph with both flows displayed. The problem comes in when I setup the tag history query in the “Data” tab of the report. I select both tags, Closest Value for aggregation mode, and OnChange for the Sample size. This creates a double entry for my flows because the change on flow1 triggers a result from flow2 and vice versa. As a work around I setup two querys but then I cannot display them in the same chart or table because I must bind it to one query. How can I design a query for this data?
If I run this query from the Database Query Browser tool then I get a nice tidy result with the data I want
SELECT *, (SELECT FROM_UNIXTIME(t_stamp/1000)) FROM sqlt_data_1_2021_12 WHERE tagid = '120' or tagid = '125'
How would you solve this? I’m new to all of this so my whole approach might be completely off.