The MIN function calculates the smaller value of two expressions.
DECIMAL. The results of MIN are dimensioned by the union of the dimensions of the two expressions.
One expression to be compared.
The other expression to be compared.
Example 8-25 Calculating Whether Actual or Budget Values Are Smaller
Suppose, for each of the first six months of 1996, you want to find whether the actual value or the budget value is smaller for the line item Cost of Goods Sold (Cogs) in the Sporting division.
LIMIT line TO 'Cogs' LIMIT division TO 'Sporting' LIMIT month TO 'Jan96' TO 'Jun96' REPORT DOWN month actual budget MIN(actual budget)
The preceding statements produce the following output.
DIVISION: SPORTING
               --------------LINE--------------
               --------------COGS--------------
                                        MIN    
                                      (ACTUAL  
MONTH            ACTUAL     BUDGET    BUDGET)  
-------------- ---------- ---------- ----------
Jan96          287,557.87 279,773.01 279,773.01
Feb96          315,298.82 323,981.56 315,298.82
Mar96          326,184.87 302,177.88 302,177.88
Apr96          394,544.27 386,100.82 386,100.82
May96          449,862.25 433,997.89 433,997.89
Jun96          457,347.55 448,042.45 448,042.45