Time or day mask on stored data

Discussion created by pt030 on Jul 23, 2013
Latest reply on Jul 28, 2013 by pt030

Hi everyone,


Say for example I query data from midnight 15-July-2013 up to midnight 23-07.2013 from PI.  There is also the notion of a time mask e.g day time period is from 8am to 5pm.  I want to retrieve only data during that day time period over those days.  I also need to find the maximum  value etc for each day during the day time period.


I can grab all the data from 15 to 23 July, loop through each value, check the timestamp and depending whether they fall in the day time period, keep or discard.  And then for each day, calculate the maximum etc on the values that I kept.


Instead of going through every value on the client side, is there something predefined or existing functionality in PI that will allow me to do this from the SDK?  Or does someone has a better suggestion to how I was going to do this?  I want to do this programatically so I'm don't want to use another tag or something like that to just keep a subset or another tag...