Home : GDIFF
Q10742 - INFO: GDIFF
 GDIFF return the min, max, average, or sum of the differenfences of a group of values based on a difference type specified.

SYNTAX:

GDIFF(VarNum,GroupOffset/StartDate,Grouping/EndDate, Stat, Type) 

VarNum:  The variable number to look at.

GroupOffset/StartDate: Used with the Grouping parameter to set the dates to calculate the stat for.  Sets the number of Groups (set by the Grouping Parameter) to be added to set the dates.  See examples below. If this field is a date string (i.e. "07/16/2004") or refers to a cell with a date in it, it is assumed to be the start date to calculate the stat for.

Grouping/EndDate: Used to set which dates to calculate the stat for.  If the Grouping is a date literal string (i.e. "07/16/2004") or refers to a cell with a date in it, it is assumed to be the end date to calculate the stat for. Common Groupings are:

"D" Days
“M” Monthly 
"R" Report Dates
Click here for availiable Grouping options

Stat:  The statistic that will be returned. possible inputs are "min", "max", "avg", or "sum".

Type:  The type of difference to be taken for each day.

Type 1: Absolute value of today - yesterday
Type 2: today - yesterday
Type 3: yesterday - today
Type 4: today - yesterday using rollover
Type 5: Yesterday - today. If result below 0, count it as 0.

NOTES:

The data that contributes to the result is only data that is dependant on the report month. This means that the difference between the 1st and the 31st is not counted.

EXAMPLES:

The above example demonstrates the use of this function with all possible outcomes. See how we can manually preform what this function does.

GDIFF(1, 1, "M", "AVG", 1)  returns the average difference of this months variables from day to day.

GDIFF(1, 1, "Y", "MAX", 1)  Returns the Maximum difference for variable 1 for an entire year.

Download Example Template: Help_GDIFF_Examples.ss3 (Click here for download instructions)

See Also: 

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 2/12/2008 10:10 AM.
Last Modified on 2/28/2008 8:51 AM.
Last Modified by No Author Name Available!.
Article has been viewed 2197 times.
Rated 0 out of 10 based on 0 votes.
Print Article
Email Article