RangeMax - script and chart function
RangeMax() returns the highest numeric value found within the expression or field.
Syntax:
RangeMax(first_expr[, Expression])
Return data type: numeric
Arguments:
Argument | Description |
---|---|
|
The expression or field containing the data to be measured. |
|
Optional expressions or fields containing the range of data to be measured.Multiple additional expressions can be used. |
Limitations:
If no numeric
value is found,
Examples and results:
Examples | Results | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
RangeMax (1,2,4) |
Returns 4 | ||||||||||||||||
|
Returns 1 |
||||||||||||||||
RangeMax (null( ), 'abc') |
Returns
|
||||||||||||||||
Add the example script to your document and run it. Then add, at least, the fields listed in the results column to a sheet in your document to see the result. RangeTab3: LOAD recno() as RangeID, RangeMax(Field1,Field2,Field3) as MyRangeMax INLINE [ Field1, Field2, Field3 10,5,6 2,3,7 8,2,8 18,11,9 5,5,9 9,4,2 ]; |
|
Example with expression:
Returns the maximum value in
the range of three values of MyField
calculated on the current row and two rows above the current row. By specifying the third argument as
Data used in examples:
MyField | RangeMax (Above(Sum(MyField),1,3)) |
---|---|
10 | 10 |
2 | 10 |
8 | 10 |
18 | 18 |
5 | 18 |
9 | 18 |
Data used in examples:
RangeTab:
LOAD * INLINE [
MyField
10
2
8
18
5
9
] ;