The best way I could think of doing this in one call would be to create an analysis in AF and query the output attribute. This approach would be ideal if you also need to compute the max, min, and average of the values (you can use the stream/getsummary call).
If you don't want to go this route, you can pull the data out with a stream /streamset and do the calculations manually or do what Dan suggested.
1 of 1 people found this helpful
Another way would be to do something like this:
The webID is the webID of the PI Server since I'm using PI Points it is all relative to a data historian. I should be able to use an AFDatabase and put in paths to attributes as well but haven't tried that yet. Only trick is to be sure to URL encode the + between cdt158 and mytag1!