WGMPn returns a weekly geometric mean from a specified variable, Cx, beginning with the day of the week specified by n.
(For N=7, the week is Sunday through Saturday.)
SYNTAX:
WGMPn(Cx, optional Time Increment)
where :
n specifies the Week Definition, which determines the begining and end of the week.
Cx is a conditional variable x
Time Increment Optional - specifies the source variables (Cx) Frequency when the Source Variable (CX) and target variable's (i.e. the variable being calculated) frequencies do not match.
NOTES:
The result of the function is stored on the last day of the defined week (n).
To account for zeros, one (1) is added to all value before performing this caluclation.
-
To ignore zeroes, see
WGMn.
-
To convert zeros to one, see
WGMCn.
The result is stored based on target variables frequency:
EXAMPLE 1: Return the Weekly geometric mean from a variable, add one to all values and subtract one from result
Source variable (71) is set to Daily and Target variable (149) is also set to Daily. Because both the Source and Target variables are the same (Daily), the time increment BYDAY will be used.
V149 = WGMP7(C71)
Variable 149 is the Weekly geometric mean (Sunday through Saturday, n = 7) of variable 71. The sample calculation below also has WGMn and WGMCn for comparison, the results for this example are highlighted in green:
EXAMPLE 2: Return the Weekly geometric mean from an Hourly variable into a Daily Calculation, add one to all values and subtract one from result.
Source variable (71) is set to Hourly and Target variable (149) is set to Daily.
V71 - Is a hourly parameter
V149 - Is a daily calculation
V149 = WGMP7(V71,BYHOUR)
Note: You MUST specify the Time Increment (BYHOUR) that matches the source variables frequency (IE the source variable V71 is Hourly, therefore we specify BYHOUR) in order for the function to return the correct value.
See: Working with Daily Detail Variables in Calculations.