Sales leaders often want more than just a list of top-performing sales reps by revenue. A deeper level of insight comes from identifying sales reps who consistently manage multiple high-value customers, maintain strong unbilled sales, and generate healthy average order values.
Using SuiteQL, administrators can efficiently surface this data by combining transactions, customers, and employee records with advanced aggregations and filtering logic. This article walks through a practical SuiteQL query that highlights sales reps managing multiple high-value customer relationships—ideal for performance reviews, territory planning, and strategic sales analysis.
Sample Query: Find Sales Reps Managing Multiple High-Value Customers
SELECT
e.entityid AS salesrep_name,
COUNT(DISTINCT c.id) AS high_value_customers,
SUM(t.amountunbilled) AS total_unbilled_sales,
AVG(t.amountunbilled) AS avg_order_value
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
HAVING
COUNT(DISTINCT c.id) >= 5 -- At least 5 high-value customers
AND SUM(t.amountunbilled) > 150000 -- Total unbilled across all their customers
AND AVG(t.amountunbilled) > 5000 -- Healthy average order value
ORDER BY total_unbilled_sales DESC
Query Breakdown
JOINs:
- Links Sales Orders to Customers
- Connects each Customer to their assigned Sales Rep (Employee)
Aggregation:
- COUNT(DISTINCT c.id) tallies unique customers per sales rep.
- SUM(t.amountunbilled) totals all unbilled sales for each rep.
- AVG(t.amountunbilled) shows the average value per sales order.
GROUP BY e.entityid: Rolls up calculations for each sales rep.
HAVING:
- Limits results to only those reps with at least 5 unique customers,
- AND who have a total unbilled sales exceeding $150,000,
- AND whose average order value is above $5,000.
ORDER BY: Ranks sales reps from highest total unbilled sales to lowest.
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.