# 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 arguments of this function may contain inter-record functions which in themselves return a list 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<br>(1,2,4)` | Returns NULL |
| `RangeOnly<br>(5,'abc')` | Returns NULL |
| `RangeOnly<br>(null( ), 'abc')` | Returns 'abc' |
| `RangeOnly(10,10,10)` | Returns 10 |

## Learn more

* [Only - chart function](https://help.qlik.com/en-US/sense/November2024/Subsystems/Hub/Content/Sense_Hub/ChartFunctions/BasicAggregationFunctions/only.htm)