Abs (N) : Argument Description
Abs (N) : Argument Description
Abs (N) : Argument Description
Description
Abs ( n )
Argument Description n
Returns
This expression counts all the product numbers where the absolute value of the product number is distinct:
Only data with an absolute value greater than 5 passes this validation rule:
Abs(value_set) > 5
See also
Ceiling
Description
Retrieves the smallest whole number that is greater than or equal to a specified limit.
Syntax
Ceiling ( n )
Argument Description n
Returns
The number for which you want the smallest whole number that is greater than or equal to it
The datatype of n. Returns the smallest whole number that is greater than or equal to n.
Examples Example 1
Ceiling(-4.2)
Ceiling(-4.8)
Example 2
This expression for a computed field returns ERROR if the value in discount_amt is greater than the smallest whole number that is greater than or equal to discount_factor times price. Otherwise, it returns discount_amt:
To pass this validation rule, the value in discount_amt must be less than or equal to the smallest whole number that is greater than or equal to discount_factor times price:
Cos
Description
Cos ( n )
Argument Description n
Returns
The angle (in radians) for which you want the cosine
Cos(0)
Example 2
Cos(1)
Example 3
Cos(Pi(1))
See also
Int
Description
Int ( n )
Argument Description n
Returns
The number for which you want the largest whole number that is less than or equal to it
The datatype of n. Returns the largest whole number less than or equal to n.
Examples Example 1
Int(3.2)
Int(3.8)
Example 2
Int(-3.2)
Int(-3.8)
See also
Max
Description
FOR range(optional)
ALL (Default) The maximum value of all rows in column. GROUP n The maximum value of rows in column in the specified group. Specify the keyword GROUP followed by the group number: for example, GROUP 1. PAGE The maximum value of the rows in column on a page. For Crosstabs, specify CROSSTAB for range:
CROSSTAB (Crosstabs only) The maximum value of all rows in column in the crosstab. For Graph and OLE objects, specify one of the following:
GRAPH (Graphs only) The maximum value in column in the range specified for the Rows option. OBJECT (OLE objects only) The maximum value in column in the range specified for the Rows option. Causes Max to consider only the distinct values in column when determining the largest value. For a value of column, the first row found with the value is used and other rows that have the same value are ignored. One or more expressions that you want to evaluate to determine distinct rows. Expresn can be the name of a column, a function, or an expression.
DISTINCT (optional)
expresn(optional)
Returns
The datatype of the column. Returns the maximum value in the rows of column. If you specify range, Max returns the maximum value in column in range.
Usage
If you specify range, Max determines the maximum value in column in range. If you specify DISTINCT, Max returns the maximum distinct value in column, or if you specify expresn, the maximum distinct value in column where the value of expresn is distinct. For graphs and OLE objects, you do not select the range when you call the function. The range has already been determined by the Rows setting on the Data property page (the Range property), and the aggregation function uses that range. Settings for Rows include the following:
For the Graph or OLE presentation style, Rows is always All. For Graph controls, Rows can be All, Page, or Group. For OLE controls, Rows can be All, Current Row, Page, or Group. The available choices depend on the layer the control occupies. Null values are ignored and are not considered in determining the maximum. Not in validation rules or filter expressions You cannot use this or other aggregate functions in validation rules or filter expressions. Using an aggregate function cancels the effect of setting Retrieve Rows As Needed in the painter. To do the aggregation, a DataWindow object always retrieves all rows.
Examples Example 1
This expression returns the maximum of the values in the age column on the page:
This expression returns the maximum of the values in column 3 on the page:
This expression returns the maximum of the values in the column named age in group 1:
Assuming a DataWindow object displays the order number, amount, and line items for each order, this computed field returns the maximum of the order amount for the distinct order numbers:
Min
Description
FOR range(optional)
ALL (Default) The minimum of all values in column. GROUP n The minimum of values in column in the specified group. Specify the keyword GROUP followed by the group number: for example, GROUP 1. PAGE The minimum of the values in column on a page. For Crosstabs, specify CROSSTAB for range: CROSSTAB (Crosstabs only) The minimum of all values in column in the crosstab. For Graph and OLE objects, specify one of the following:
GRAPH (Graphs only) The minimum of values in column in the range specified for the Rows option. OBJECT (OLE objects only) The minimum of values in column in the range specified for the Rows option. Causes Min to consider only the distinct values in column when determining the minimum value. For a value of column, the first row found with the value is used and other rows that have the same value are ignored. One or more expressions that you want to evaluate to determine distinct rows. Expresn can be the name of a column, a function, or an expression.
DISTINCT (optional)
expresn(optional)
Returns
The datatype of the column. Returns the minimum value in the rows of column. If you specify range, Min returns the minimum value in the rows of column in range.
Usage
If you specify range, Min determines the minimum value in column in range. If you specify DISTINCT, Min returns the minimum distinct value in column, or if you specify expresn, the minimum distinct value in column where the value of expresn is distinct. For graphs and OLE objects, you do not select the range when you call the function. The range has already been determined by the Rows setting on the Data property page (the Range property), and the aggregation function uses that range. Settings for Rows include:
For the Graph or OLE presentation style, Rows is always All. For Graph controls, Rows can be All, Page, or Group.
For OLE controls, Rows can be All, Current Row, Page, or Group. The available choices depend on the layer the control occupies. Null values are ignored and are not considered in determining the minimum. Not in validation rules or filter expressions You cannot use this or other aggregate functions in validation rules or filter expressions. Using an aggregate function cancels the effect of setting Retrieve Rows As Needed in the painter. To do the aggregation, a DataWindow object always retrieves all rows.
Examples Example 1
This expression returns the minimum value in the column named age in group 2:
Min(age for group 2)
Example 2
This expression returns the minimum of the values in column 3 on the page:
Min(#3 for page)
Example 3
Assuming a DataWindow object displays the order number, amount, and line items for each order, this computed field returns the minimum of the order amount for the distinct order numbers:
Min(order_amt for all DISTINCT order_nbr)
See also
Mod
Description
Mod ( x, y )
Argument Description
Argument Description x y
Returns
The number you want to divide by y The number you want to divide into x
Mod(20, 6)
Example 2
Mod(25.5, 4)
Example 3
Mod(25, 4.5)
See also
Pi
Description
Pi ( n )
Argument Description n
Returns
Pi(1)
Example 2
Both these expressions return the area of a circle with the radius Rad:
Cos(45.0 * (Pi(2)/360))
See also
Round
Description
Round ( x , n )
Argument Description x n
Returns
The number you want to round. The number of decimal places to which you want to round x. Valid values are 0 through 28.
Decimal. If n is positive, Round returns x rounded to the specified number of decimal places. If n is negative, it returns x rounded to (- n +1) places before the decimal point. Returns 1 if it fails.
Examples Example 1
Round(9.624, 2)
Example 2
Round(9.625, 2)
Example 3
Round(9.6, 3)
Example 4
Round(-9.625, 2)
Example 5
Round(-9.625, -1)
See also
Sign
Description
Reports whether the number is negative, zero, or positive by checking its sign.
Syntax
Sign ( n )
Argument Description n
Returns
Example 3
Sqrt
Description
Sqrt ( n )
Argument Description n
Returns
Sqrt(2)
Example 2
Sqrt(-2)
See also
Truncate
Description
Truncate ( x,
n )
Argument Description x n
Returns
The number you want to truncate. The number of decimal places to which you want to truncate x. Valid values are 0 through 28.
The datatype of x. If n is positive, returns x truncated to the specified number of decimal places. If n is negative, returns x truncated to (- n +1) places before the decimal point. Returns 1 if it fails.
Examples Example 1
Truncate(9.22, 1)
Example 2
Truncate(9.28, 1)
Example 3
Truncate(9.9, 0)
Example 4
Truncate(9.29, 1)
Example 5
Truncate(9.2, 1)
Example 6
Truncate(54, 1)
See also