Tracking Unbilled Sales helps Administrators understand pending revenue and manage billing workloads more effectively. Using SuiteQL, you can quickly analyze which Customers have the highest Unbilled Amounts by leveraging the amountunbilled field in the transaction record.
The query below summarizes total Unbilled Sales per Customer and ranks them from highest to lowest, giving you a clear view of outstanding revenue opportunities.
SELECT c.entityid AS customer_name, SUM(t.amountunbilled) AS total_sales
FROM transaction t
JOIN customer c ON t.entity = c.id
WHERE t.type = 'SalesOrd'
GROUP BY c.entityid
ORDER BY total_sales DESC
- SELECT c.entityid AS customer_name - Retrieves the Customer name to display in the results.
- SUM(t.amountunbilled) AS total_sales - Calculates the total Unbilled Amount per Customer.
- FROM transaction t - Pulls data from the Transaction record.
- JOIN customer c ON t.entity = c.id - Connects each Transaction to the corresponding Customer.
- WHERE t.type = 'SalesOrd' - Filters the results to include only Sales Orders.
- GROUP BY c.entityid - Groups results by Customer, enabling aggregated totals.
- ORDER BY total_sales DESC - Sorts Customers from highest to lowest Unbilled Amount.
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.