Skip to main content

coalesce (Function)

This returns the first input parameter value of the given argument, that is not null.

Syntax

<INT|LONG|DOUBLE|FLOAT|STRING|BOOL|OBJECT> str:coalesce(<INT|LONG|DOUBLE|FLOAT|STRING|BOOL|OBJECT> arg, <INT|LONG|DOUBLE|FLOAT|STRING|BOOL|OBJECT> ...)

Query Parameters

NameDescriptionDefault ValuePossible Data TypesOptionalDynamic
argIt can have one or more input parameters in any data type. However, all the specified parameters are required to be of the same type.INT LONG DOUBLE FLOAT STRING BOOL OBJECTNoYes

Example 1

coalesce(null, "BBB", "CCC")

This returns the first input parameter that is not null. In this example, it returns "BBB".