MAX
Syntax
MAX (arg1, arg2, . . . arg16)
Description
The MAX Function returns the maximum of a series of values. The MAX Function accepts up to 16 arguments.
Example
Given A = 4, B = 3, C = 2, D = 1
MAX(A, B, C, D) returns A.
You can sometimes simplify formulas by using the MAX function instead of the IF function. For example, suppose an analytic model contains data cubes called CASH_BALANCE and CASH_MINIMUM. You might be tempted to calculate the CASH_NEEDED cube by using the following formula:
IF(CASH_BALANCE < CASH_MINIMUM,CASH_MINIMUM - CASH_BALANCE, 0)
In other words, if CASH_BALANCE is less than CASH_MINIMUM, return the amount required to attain the minimum cash level; otherwise, return zero. Although the IF function does the job, it is simpler to use the MAX function:
MAX(CASH_MINIMUM - CASH_BALANCE, 0)
If CASH_BALANCE is greater than CASH_MINIMUM, the first argument is negative, so the formula returns zero for CASH_NEEDED. If CASH_BALANCE is less than CASH_MINIMUM, the first argument is positive, so the formula returns the amount required to attain the minimum cash level.