Home : GPREC
Q10790 - INFO: GPREC
GPREC returns the min or max precision (significant figures) of entries for a certain variable.

SYNTAX:

GPREC(Start/End Flag,Grouping/EndDate, GroupOffset/StartDate, Type, optional MinVal) 

Start/End Flag:  Enter 1 to get the start date. Enter 2 to get the end date. All other numbers may return unknown results.

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 available Grouping options

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.

Type:  Tells the function to either return min or max. Possible inputs are "min" or "max"

MinVal:  The minimum value to to check against, returns this number if all values are below MinVal. This is an optional parameter.

NOTES:

GPREC can only be used on variables that allow symbols. When entires are made of this type of variable, users can enter data with different precision and a different number of decimal places.

Rules for significant figures:

  • Digits from 1-9 are always significant.
  • Zeros between two other significant digits are always significant
  • One or more additional zeros to the right of both the decimal place and another significant digit are significant.
  • Zeros used solely for spacing the decimal point (placeholders) are not significant.

SEE ALSO:  GDP, SFRZ, SFR, DPC

EXAMPLES:

GPREC(4697,1,"M","min",5)

GPREC(1, 1, "M", "min")  This will return the minimum precision of the variable 1.

GPREC(1, 1, "M", "max")  This will return the maximum precision of the variable 1.

GPREC(1, 1, "M", "min", 3)  This will return the minimum precision of the variable 1, ignoring anything with a precision smaller than 3.

Download Example Template: Help_GPREC_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/20/2008 3:43 PM.
Last Modified on 1/25/2016 1:23 PM.
Last Modified by Scott Dorner.
Article has been viewed 3516 times.
Rated 5 out of 10 based on 4 votes.
Print Article
Email Article