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 WIDTH_BUCKET
The WIDTH_BUCKET divides a range into equal-sized intervals, called buckets, and returns the bucket number for each value. This helps group values, such as customer credit limits, for analysis.
Syntax
WIDTH_BUCKET(expression, min_value, max_value, num_buckets)