Table of Contents

Search

  1. Preface
  2. Function reference
  3. Constants
  4. Operators
  5. Dates
  6. Functions
  7. System variables
  8. Datatype reference

Function Reference

Function Reference

LEAST

LEAST

Returns the smallest value from a list of input values. By default, the match is case sensitive.

Syntax

LEAST(
value1
, [
value2
, ...,
valueN
,]
CaseFlag
)
Argument
Required/
Optional
Description
value
Required
Any datatype except Binary. Datatype must be compatible with other values. Value you want to compare against other values. You must enter at least one value argument.
If the value is Numeric, and other input values are of other numeric datatypes, all values use the highest precision possible. For example, if some values are of the Integer datatype and others are of the Double datatype,
Data Integration
converts the values to Double.
CaseFlag
Optional
Must be an integer. Determines whether the arguments in this function are case sensitive. You can enter any valid expression.
When
CaseFlag
is a number other than 0, the function is case sensitive.
When
CaseFlag
is a null value or 0, the function is not case sensitive.

Return Value

value1
if it is the smallest of the input values,
value2
if it is the smallest of the input values, and so on.
NULL if all the arguments are null.

Example

The following expression returns the smallest quantity of items ordered:
LEAST( QUANTITY1, QUANTITY2, QUANTITY3 )
QUANTITIY1
QUANTITY2
QUANTITY3
RETURN VALUE
150
756
27
27
NULL
5000
97
17
17
120
1724
965
120

0 COMMENTS

We’d like to hear from you!