Home : How to calc values only in certain hours
Q13885 - INFO: How to calc values only in certain hours

Filter Specific Hourly Values from an Hourly SCADA Variable. 

How do I get the values from the 2AM,6AM,10AM,2PM,6PM and 10PM hour slot from an hourly variable that has values every hour?

 


I first created a variable, 35071, that calculated the current hour of the day using the equation using the Hour and D math toolbox function:

Method 1:  Hour(D)
Method 2: (D-trunc(D))

Then, of course there is the data variable, 35072, an hourly variable receiving data from SCADA

Next I created a variable, 35073, that uses an if statement to selectively pick data from specific hours.  The equation for this is:

                   if(v35071=2 or v35071=6 or v35071=10 or v35071=14 or v35071=18 or v35071=22, v35072, blank)

That’s it!  Now you can use DDMIN, DDCC, etc to summarize variable 35073.

 

Alternatively, if this needs to be done multiple times, you could create a variable like 35074 above.  This variable returns a 1 for the specified hours and blank for the rest.

                   if(v35071=2 or v35071=6 or v35071=10 or v35071=14 or v35071=18 or v35071=22, 1, blank)
         
  This way, multiple variables can use a much simpler equation to grab data from other data variables, like:

                   if(not isblank(c35074), v35072, blank)

Related Articles
No Related Articles Available.

Article Attachments
No Attachments Available.

Related External Links
No Related Links Available.
Help us improve this article...
What did you think of this article?

poor 
1
2
3
4
5
6
7
8
9
10

 excellent
Tell us why you rated the content this way. (optional)
 
Approved Comments...
No user comments available for this article.
Created on 4/27/2012 10:12 AM.
Last Modified on 5/14/2015 3:09 PM.
Last Modified by Scott Dorner.
Article has been viewed 3067 times.
Rated 0 out of 10 based on 0 votes.
Print Article
Email Article