Discussions
Stay up-to-date with the latest news from NetSuite. You’ll be in the know about how to connect with peers and take your business to new heights at our virtual, in-person, on demand events, and much more.
New AI Community Guidelines. Please review and follow them to ensure AI use stays safe, accurate, and compliant.
Please note that on Saturday, April 18, 2026, at 8:00 PM Pacific Time, our Case Management System will undergo a scheduled maintenance for approximately 15 minutes. During this time, case creation via SuiteAnswers will be unavailable and inbound calls will be routed to Customer Service.
Better way of writing this SQL CASE WHEN statement
Does anybody fancy themselves a SQL guru that would like to give me some pointers on cleaning up this mess of a CASE WHEN statement? We have a list of product lines (item classes) that either roll up as Product or Services that our company offers. My management wants to see Gross Profit and Revenue numbers broken out as well as overall and the SQL statement I've come up with below is the best way I have figured out to make that happen. Below is an example of how I calculate the Services Gross Profit numbers from a search with
0