3 of 3 people found this helpful
You should be able to inner join several tables such as the one below using their starttime as the join condition. TagTot, TagMin,TagAvg,TagMax PE functions can be used for your various summary columns
Example using TagAvg to get averages based on events (time periods) of another tag SELECT starttime, endtime, TAGAVG('yourdailyquantitytag', starttime, endtime) avg FROM (SELECT c1.tag, c1.time starttime, (SELECT TOP 1 c2.time FROM picomp2 c2 WHERE c2.tag = c1.tag AND c2.time > c1.time) endtime FROM picomp2 c1 WHERE c1.tag = 'Crude.PV' AND c1.time BETWEEN '*-1d' AND '*') t
PS: Binding your time range for a query in picomp2 is recommended. I noticed you didn't constraint your time column.
I succeeded by this example, thank you!
Do you know how to get the number of days between StartTime and EndTime?