Top  | Previous | Next

Logic / coalesce

coalesce(value1, value2, ...)

This function, which accepts any number of arguments, evaluates each in order, and returns the first non-null argument. Typically, you would call this with two arguments - the first being something dynamic, the second being a static value to use as a guard in case the dynamic value is null. The function itself detects its return type based on the type of the last argument.

 

coalesce(null, "abc"

...would return "abc"

 

coalesce("xyz""abc"

...would return "xyz"

 

coalesce({Root Container.MyDataSet}["ColumnName"], 0) 

...would return the value in the dataset if it isn't null, but 0 if it is null.