Home : Products : Hach WIMS : Hach WIMS Client : Documentation : Function Reference : Math Toolbox Functions : Searching Functions : CV
Q14326 - INFO: CV
CV(Cx, SearchDays, Stat_If_Tie) Returns the closest value entered for the variable specified. Searches forward and backward and uses the value whose datestamp that is closest to the time being calculated.  If there is a tie (e.g. there is a value yesterday and a value tomorrow) it will then use the Stat_If_Tie to calculate the value.  Will only search up to the number of SearchDays specifed (forward and backward). If no data is found in either direction the result is a blank. The variable to be searched must be specified as a Conditional Variable (use a "C" instead of a "V").

SYNTAX:

CV(Cx, SearchDays, Stat_If_Tie)
where :
Cx is a conditional variable x
SearchDays: Specifies the number of days to search from the date being calculated (ex. 7 would mean search up to 7 days forward and 7 days backwards for values). SearchDays must be a value other than 0. Keep in mind that as the value of SearchDays increases, the equation may take much longer if it does not find a recent value.

Stat_If_Tie: A quoted string that specfies what to calculate when the 2 values are the same time difference from the slot being calculated. 

Stat Description
First Use the First (earlier) value

Last

Use the Last (later) value
Avg Average the two values
Min Use the minimum of the two values
Max Use the maximum of the two values

EXAMPLES:

Find closet value from V8005.  Search up to 30 days forward and backward for values.  If there is a tie, average the two values.

V8060 = CV(C8005,30, "AVG")

 

Find Closest value from a daily detail variable.  

V8023 = CV(C8015,30,"AVG")

 

Find the closest 4 Hour value into an hourly Calc.

V1271 = CV(1261,7,"MAX")  - V1271 is an hourly calc and V1261 is a 4 hour parameter.

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 5/26/2015 4:08 PM.
Last Modified on 9/28/2015 2:05 PM.
Last Modified by Scott Dorner.
Article has been viewed 2323 times.
Rated 0 out of 10 based on 0 votes.
Print Article
Email Article