ifNotFinite
This section contains reference documentation for the ifNotFinite function.
Returns the input value if it is finite, otherwise returns the specified default value. Useful for replacing infinite or NaN values with a fallback.
Signature
ifNotFinite(valueToCheck, defaultValue)
Argument
Type
Description
valueToCheck
DOUBLE
Value to check for finiteness
defaultValue
DOUBLE
Value to return if valueToCheck is not finite
Returns: DOUBLE
Usage Examples
SELECT ifNotFinite(ratio, 0) AS value
FROM myTableReturns ratio if it is finite, otherwise returns 0.
SELECT ifNotFinite(1.0 / 0.0, -1) AS value
FROM myTablevalue
-1.0
SELECT ifNotFinite(42.5, -1) AS value
FROM myTablevalue
42.5
Last updated
Was this helpful?

