I am trying to decide what the best strategy would be to use the Calculate function or some other SDK function to get a max value for an expression excluding spikes in the results of the expression.

So a simple example is to find the max of tag1+tag2 within a month’s date range ignoring any 2 second duration where the expression (tag1+tag2) has a radical negative AND positive slope.

It seems like FilteredSummaries should work but I am a little baffled about how to apply the appropriate summary expression and how to get the correct output.

Thanks, Dan

FilteredSummaries would be useful if you are intending to get max, min value from a tag, with a filter expression to filter unwanted values to be used in the calculation. On the other hand, if you are looking for ways to find summary values from an expression, you should look at ExpressionSummaries (which calculates the summary results (max, min, total, etc) of an expression.

I am not sure how exactly we can express the condition "2 seconds duration where expression has radical negative AND positive slope" as a PE expression. Assuming that you want to ignore a value that exceeds a certain limit instead, the expression can be like "IF ('tag1' + 'tag2' <2000) THEN 'tag1' + 'tag2' ELSE NoOutput()"

Using that in ExpressionSummaries, to get a max of tag1 + tag2 in 1 month will be something like