As a NetSuite Administrator, you may be asked to quickly identify high-value sales orders for executive reporting, finance review, or approval workflows. Rather than manually filtering transaction lists, you can use SuiteQL to automatically categorize sales orders based on their transaction amount.
This approach is useful for organizations that need to:
- Prioritize review of large customer orders.
- Support approval workflows for high-value transactions.
- Build SuiteAnalytics datasets or custom reports.
- Monitor sales trends by transaction value.
- Feed integrations or dashboards with categorized transaction data.
In this example, Sales Rrders with a total greater than 1,000 (in the transaction currency) are classified as High Value, while all others are categorized as Standard.
SuiteQL Example
SELECT
t.tranid,
-- Display the customer associated with the transaction
c.entityid AS customer,
-- Transaction total in the transaction currency
t.foreigntotal,
-- Replace NULL transaction totals with 0 before evaluating the amount.
-- Transactions greater than 1,000 are labeled as High Value.
CASE
WHEN NVL(t.foreigntotal, 0) > 1000 THEN 'High Value'
ELSE 'Standard'
END AS transaction_type
FROM
transaction t
INNER JOIN
customer c
ON
t.entity = c.id
-- Return only Sales Order transactions
WHERE
t.type = 'SalesOrd'
-- Sort highest-value transactions first
ORDER BY
t.foreigntotal DESC;
To easily execute a SuiteQL query, see NetSuite Admin Tip | Running SUITEQL Using a Suitelet
DISCLAIMER: The sample code described herein is provided on an "as is" basis, without warranty of any kind, to the fullest extent permitted by law. Oracle + NetSuite Inc. does not warrant or guarantee the individual success developers may have in implementing the sample code on their development platforms or in using their own Web server configurations.
Oracle + NetSuite Inc. does not warrant, guarantee or make any representations regarding the use, results of use, accuracy, timeliness or completeness of any data or information relating to the sample code. Oracle + NetSuite Inc. disclaims all warranties, express or implied, and in particular, disclaims all warranties of merchantability, fitness for a particular purpose, and warranties related to the code, or any service or software related thereto.
Oracle + NetSuite Inc. shall not be liable for any direct, indirect or consequential damages or costs of any type arising out of any action taken by you or others related to the sample code.
We’d love to hear how you integrate SuiteQL into your NetSuite processes! Share your insights and experiences in the NetSuite Admin Corner.