How to find, min, max, and standard deviation for PI points in last 7 days, using query?
I want to find PI points that a lot deviate from the mean.
There are many ways to do this. You could use PI OLEDB Provider with a query such as
select maxquery.tag, maxquery.value as max, sd.value as [standard deviation] From (SELECT tag , value FROM [piarchive]..[pimax] WHERE tag like 'sin*' AND time BETWEEN '*-1h' AND '*') maxquery inner join (SELECT tag, value FROM [piarchive]..[pipstd] WHERE tag like 'sin*' AND time BETWEEN '*-1h' AND '*') sd on maxquery.tag = sd.tag
I left our the minimum, but you could easily add that in yourself. Of course there is always PI Datalink, PI Web API, AF SDK, the table symbol in PI Vision among other options.
The easiest way is to add tags using PI Calc. (data set).
Min, max and standard deviation are all provided functions by default. Please see more in below user guide: PI ProcessBook User Guide - PI Calculation data sets
Can you give me please an example of how to do this?
Refer to this YouTube video along the way:OSIsoft: Use a PI Calculation in a trend. v3.2.
Because the video is created such a long time ago, the UI might be different from yours. But they should be largely the same.
After you select to add PI Calc. data set from your trend, you can set parameters as below:
but this is not practical to scan a large number of PI points... is it possible to do this trough one SQL query?
List of all points, min, max & stdev
This is example through PI DataLink...
this should solve the problem, but cannot get any results...
I tried to change 'sin*' to my parameters... I want to list all tags.
What could be wrong?
I had a little typo in my post. I apologize for this and fixed it! I had edited the query after directly in PIsquare and didn't test my edits! I fixed it so copy the query and try again.
Retrieving data ...