AnsweredAssumed Answered

How to ignore the sum values where any of the Tag Value  > 10000 in the query

Question asked by GopinathSridara on Oct 5, 2016
Latest reply on Oct 6, 2016 by kduffy
Branched to a new discussion

The below query is used to find the time at which maximum sum of all tag values occurred.

 

How to modify it to ignore the sum values where any of the tag value is more than 10000.

 

SELECT TOP 1 TIME, CAST(VALUE AS FLOAT32) AS VALUE FROM PIARCHIVE..PICALC

 

WHERE EXPR = '''tag1 Value''+''Tag2 Value''' AND TIME >= '01-Oct-2016 09:00' AND TIME <= '05-Oct-2016 11:30' AND TIMESTEP = '30m' ORDER BY VALUE DESC

 

                8AM       8.30 AM      9 AM

Tag1       111           222            300

tag2      10000         220            150

----------------------------------------------------- 

SUM        10111       442          450

 

I need a query which gives answer as 9AM where the above query is giving 8AM.

Thanks in advance.

Outcomes