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.