RangeOnly - script and chart function
RangeOnly() is a dual function that returns a value if the expression evaluates to one unique value. If this is not the case then NULL is returned.
Syntax:
RangeOnly(first_expr {, Expression})
Return data type: dual
Arguments:
The argument expressions of this function may contain inter-record functions with a third optional parameter, which in themselves return a range of values.
Argument | Description |
---|---|
first_expr | The expression or field containing the data to be measured. |
Expression | Optional expressions or fields containing the range of data to be measured. |
Examples and results:
Examples | Results |
---|---|
RangeOnly (1,2,4) |
Returns NULL |
RangeOnly (5,'abc') | Returns NULL |
RangeOnly (null( ), 'abc') |
Returns 'abc' |
RangeOnly(10,10,10) | Returns 10 |
Example with expression:
RangeOnly (Above(Sum(MyField),0,3))
Returns one value if the three results of the Sum(MyField) function over the current row and two rows above the current row contain exactly one value.
Data used in examples:
MyField | Sum(MyField) | RangeOnly(Above(Sum(MyField),0,3)) |
---|---|---|
10 | 10 | Returns 10 because there are no rows above this row so 2 of the 3 values are missing (=NULL). |
abc | 0 | |
8 | 8 | |
def | 0 | |
xyz | 0 | |
9 | 9 |
Learn more
Did this page help you?
If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!