Specifications
CHAPTER 24 DataWindow Expression and InfoMaker Functions
Users Guide 709
Assuming a report displays the order number, amount, and line items for each
order, this computed field returns the median of the order amount for the
distinct order numbers:
Median(order_amt for all DISTINCT order_nbr)
See also
Avg
Mode
Mid
Description Obtains a specified number of characters from a specified position in a string.
Syntax Mid ( string, start {, length } )
Return value
String. Returns characters specified in length of string starting at character
start. If start is greater than the number of characters in string, the
Mid function
returns the empty string (“”). If length is greater than the number of characters
remaining after the start character,
Mid returns the remaining characters. The
return string is not filled with spaces to make it the specified length.
Examples This expression returns “”:
Mid("BABE RUTH", 40, 5)
This expression returns BE RUTH:
Mid("BABE RUTH", 3)
This expression in a computed field returns ACCESS DENIED if the fourth
character in the column password is not R:
If(Mid(password, 4, 1) = "R", "ENTER", "ACCESS DENIED")
Argument Description
string The string from which you want characters returned.
start A long specifying the position of the first character you want
returned (the position of the first character of the string is 1).
length
(optional)
A long whose value is the number of characters you want returned.
If you do not enter length or if length is greater than the number of
characters to the right of start,
Mid returns the remaining characters
in the string.