In New to NetSuite | SuiteQL Overview and New to NetSuite | Understanding SuiteQL Syntax articles, we explored the fundamental concepts, capabilities, and structure of SuiteQL.
SuiteQL Syntax for Advanced Queries goes beyond simple selections and joins to deliver robust, flexible, and analytical queries within database. SuiteQL’s capabilities are similar to standard SQL (with some NetSuite-specific constraints). One of these advanced features is NVL2.
The NVL2 is a function that checks whether a value is NULL or not NULL, then returns one value if the field contains data and a different value if the field is empty (NULL).
Syntax
NVL2(expression, value_if_not_null, value_if_null)