Home : Products : Hach WIMS : Hach WIMS Client : Documentation : Function Reference : Math Toolbox Functions : WDIFn
Q10901 - INFO: WDIFn

WDIFn returns the difference between weekly values, Vx, and locates the difference on the last day of the week.

SYNTAX:

WDIFn(Cx, Optional Rollover)
where :
n specifies the week definition to use when performing the calculation.
Cx is a conditional variable x
Rollover is an optional parameter that specifies the Rollover Point.

NOTES:

If Rollover is not specified, the system assumes a rollover at the next power of 10.

EXAMPLES:

#1. Weekly difference of a daily variable with a rollover of 100

V140 = WDIF7(V71,100)

Variable 140 will be the weekly difference of variable 71 from Sunday to Saturday (n=7), with a rollover point of 100:

 

#2. Weekly difference of a 4 hour variable with a rollover of 100 calculated into a Daily Calculation

V8002 = WDIF7(V8001)

V8001 is a 4 hour parameter
V8002 is a daily calculation

Week Definition of 7 is Sunday thru Saturday.

WDIF function will first find the last value of the week being calculated.  Since V2 is a Daily Detail variable it will look at the last slot on Saturday (e.g. for a 4 hour variable would be the 8PM to midnight slot on Saturday).  Next it will search for a value starting on the last slot BEFORE the previous Sunday.  See examples:

 

NOTE: WDIF will search starting in the first slot before the week being calculated and search back up to 8 days.  If it does not find a value, it will then search starting on the beginning of the week forward up to 6 days to find a value (e.g. Start on Sun the 4th at 12:00 AM and search thru the end of Fri the 9th).  IF no value is found, zero is assumed and 0 is subtracted from the last value for the week. 

 

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/11/2008 4:00 PM.
Last Modified on 2/9/2015 4:53 PM.
Last Modified by Scott Dorner.
Article has been viewed 4340 times.
Rated 0 out of 10 based on 0 votes.
Print Article
Email Article