As a NetSuite Administrator, having clear visibility into your Sales Team’s performance is essential. While standard reports provide a general overview, sometimes you need more targeted insights—such as:
- Who closed the largest single deal?
- Which Sales Rep generated the highest total sales?
- How many Sales Orders did each rep handle?
Using SuiteQL, you can extract this information efficiently and customize the analysis based on your business needs.
This query helps you:
- Identify top-performing Sales Reps based on largest single Sales Order
- Measure overall sales contribution
- Analyze sales volume (number of transactions)
- Support performance reviews and incentive programs
- Provide management with data-driven insights
SuiteQL Query: Largest & Total Sales Order Values per Sales Rep
SELECT
e.entityid AS salesrep_name, -- Sales rep's display name
MAX(t.foreigntotal) AS largest_order, -- Largest single sales order for the rep
SUM(t.foreigntotal) AS total_sales, -- Total sales for the rep
COUNT(t.id) AS num_sales_orders -- Total number of sales orders handled
FROM transaction t
JOIN customer c ON t.entity = c.id
JOIN employee e ON c.salesrep = e.id
WHERE t.type = 'SalesOrd'
GROUP BY e.entityid
ORDER BY largest_order DESC -- Show reps with the biggest deals at the top
- transaction (t) – Pulls Sales Order records.
- customer (c) – Links the Sales Order to the Customer.
- employee (e) – Retrieves the assigned Sales Rep.
- MAX(t.foreigntotal) – Gets the largest single Sales Order per rep.
- SUM(t.foreigntotal) – Calculates total sales per rep.
- COUNT(t.id) – Counts total Sales Orders handled.
The results are grouped by Sales Rep and sorted by the largest single deal, highlighting big closers first.
To easily execute a SuiteQL query, see NetSuite Admin Tip | Running SUITEQL Using a Suitelet
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.