# coalesce Script and chart function

The coalesce function returns the first of the parameters that has a valid non-NULL representation. Any number of parameters can be used.

Syntax:

coalesce(expr1[ , expr2 , expr3 , ...])

Arguments:

Arguments

| Argument | Description |
| --- | --- |
| expr1 | The first expression to check for a valid non-NULL representation. |
| expr2 | The second expression to check for a valid non-NULL representation. |
| expr3 | The third expression to check for a valid non-NULL representation. |

[](https://help.qlik.com/en-US/qlikview/Subsystems/Client/Content/QV_QlikView/Scripting/ConditionalFunctions/coalesce.htm)

#### Examples and results:

Scripting examples

| Example | Result |
| --- | --- |
| `Coalesce(ProductDescription, ProductName, ProductCode, 'no description available')` | This expression will select between three different product description fields, for when some fields may not have values for the product. The first of the fields, in the order given, with a non-null value will be returned.<br>If none of the fields contain a value, the result will be 'no description available'. |
| `Coalesce(TextBetween(FileName, '"', '"'), FileName)` | This expression will trim potential enclosing quotes from the field FileName. If the FileName given is quoted, these are removed, and the enclosed, unquoted FileName is returned.<br>If the TextBetween function doesn't find the delimiters it returns null, which the Coalesce rejects, returning instead the raw FileName. |