Why a NetSuite Invoice Saved Search Shows More Rows Than Invoices

An invoice saved search returns a main line plus item and tax lines for every invoice. Use Main Line and Tax Line criteria to get one row per invoice or one row per item.

The quick answer

A Transaction saved search with only Type is Invoice returns every line of every invoice. Each invoice shows up as its main line (the header row, marked with an asterisk) plus its item lines and, in accounts where sales tax posts as a separate line, a tax line. Add Main Line = Yes to get one row per invoice. Main Line = No drops the main line but keeps every other line. To get down to item lines, also add Tax Line = No, plus Shipping Line = No and COGS Line = No if your invoices have those rows.

The screenshots show sample data. Person and operating-company names are fictional. The row counts come from this example, so use them to see the pattern, not to predict your own results.

Before you start

You need a role that can create or edit Transaction saved searches and see invoices. The example account has three invoices. Sales tax posts as its own line, as it does with legacy tax, and the invoices have no shipping or COGS rows. How many rows an invoice returns depends on its lines and on your account's tax, shipping, and inventory setup. SuiteTax accounts and invoices with discounts can look different.

The example search is called Invoice Row Check. It's a Transaction saved search with one criterion, Type is Invoice, and no date or status filter. If you're building your own, create a Transaction saved search and set that criterion first. Its results show Main Line, Date, Type, Document Number, Name, Account, Item, and Amount. The Main Line column's header is an asterisk, and it puts an asterisk on each main line. Keep it and Account in your results while you test this, so you can tell a header row from a line row.

01. Look at one invoice

Start with an invoice you know. INV-1041 for Brightwater Labs has a Summary of Subtotal 1,650.00, Tax Total 136.13, and Total 1,786.13.

INV-1041 totals 1,786.13: a 1,650.00 subtotal plus 136.13 of tax.

On the Items subtab it has two item lines, Pressure Calibrator for 1,200.00 and Calibration Service for 450.00. The tax isn't a line on this subtab. It shows up as its own row in the search. Keep those four numbers in mind for the next step.

Two item lines: 1,200.00 and 450.00.

02. Preview without a Main Line criterion

Open the saved search from Reports > Saved Searches > All Saved Searches. On Criteria > Standard, the only criterion is Type is Invoice. Click Preview.

The starting search has one criterion: Type is Invoice.

The results say Total: 12 for three invoices. INV-1041 appears four times:

  • a row with an asterisk in the Main Line column, on 1200 Accounts Receivable, for the invoice total of 1,786.13;
  • two item rows, on 4000 Sales for 1,200.00 and 4100 Service Revenue for 450.00;
  • a tax row on 2400 Sales Tax Payable for 136.13. In this account it shows the tax item TX Sales Tax 8.25% under Item and the tax agency, State Comptroller, as its Name.

The asterisk row is the main line. The other two invoices follow the same pattern. If you summed Amount across all 12 rows in this example, you'd get each invoice twice: once as its total on the main line and again split across its item and tax lines. With shipping, discounts, or COGS rows the math changes, but a mixed sum is still wrong.

The asterisk marks INV-1041's main line. The three rows under it are its lines.

03. Set Main Line to Yes

Click Return To Criteria. In the empty filter row, choose Main Line. A popup offers Either, Yes, and No. Either is what you just saw, with no filtering. Select Yes and click Set. The criterion row now reads Main Line is true.

Main Line is a Yes/No choice. Select Yes for header rows only.

Click Preview. The results now say Total: 3, one asterisk row per invoice on 1200 Accounts Receivable with the invoice total: 1,786.13 for INV-1041, 2,792.85 for INV-1042, and 1,255.70 for INV-1043.

Main Line = Yes: Total: 3, one row per invoice.

Use this grain to count invoices or total invoice amounts. It stays at one row per invoice only while nothing else adds rows. Results columns or criteria from a related record with many rows per invoice, such as a customer's contacts, can multiply the rows again.

04. Set Main Line to No

Click Return To Criteria, click the is true description on the Main Line row, select No, and click Set. Click Preview.

The results say Total: 9. The asterisk rows are gone, and each invoice now shows its two item lines and its tax line. Main Line = No keeps every row except the main line. Here that's item and tax lines. In other accounts it can also include shipping, COGS, discount, or other lines.

Main Line = No: Total: 9. Every invoice still has a TX Sales Tax 8.25% row.

05. Add Tax Line = No

Click Return To Criteria. In the empty filter row, choose Tax Line. It has the same Either, Yes, and No choice. Select No and click Set. The criteria now read Type is Invoice, Main Line is false, and Tax Line is false.

Three criteria: Type is Invoice, Main Line is false, Tax Line is false.

Click Preview. The results say Total: 6, the two item lines of each invoice. In this example, Amount now adds up to item-level sales with no tax rows mixed in.

Tax Line = No removes the tax rows. Six item lines remain.

These invoices have no shipping or COGS rows. If yours can, also add Shipping Line = No and COGS Line = No. Then look over a few real invoices in the preview for any other line types your account adds, like discounts.

06. Check the rows before you save

Preview doesn't save the definition. Before you click Save, check the preview against the question the search has to answer:

  • One row per invoice: every row has an asterisk, the Total matches the number of invoices your criteria should return, and Amount is each invoice's total.
  • One row per item line: no asterisk rows and no tax item in the Item column. In this example the item amounts for each invoice add up to its Subtotal: INV-1041's two rows make 1,650.00. Discount or credit lines can break that check, so know what your invoices contain.

This search only filters on Type, so its count includes every invoice your role can see. If you need open, unpaid, or current-period invoices, add those criteria too. Pick the rows first, then add your columns, summaries, and filters. They all work on whatever rows the criteria leave. When the preview looks right, click Save. Saving keeps the search definition and doesn't change any invoice.

Common questions

What does the asterisk in NetSuite saved search results mean?

It marks the main line, the transaction's header row. When you add Main Line as a results column, its header is an asterisk and each main-line row gets one. In this example that row sits on Accounts Receivable with the invoice total, and the rows without an asterisk are the invoice's item and tax lines.

What's the difference between Main Line = Yes and Main Line = No?

Yes keeps only the main line, so three invoices return three rows. No keeps every other row, which isn't the same as items only. Depending on your setup that can include tax, shipping, COGS, or discount lines. Either doesn't filter on Main Line at all.

Why is the Amount total in my saved search too high?

Without a Main Line filter, the search returns each invoice's total on the main line and the same money again, split across its lines. Summing Amount over that mix counts the invoice more than once. Pick one grain first: Main Line = Yes for invoice totals, or item lines only for item amounts.

Why do tax lines show up when Main Line is No?

When sales tax posts as its own line, which is how legacy tax works, the tax line is a line-level row like any item line. It usually shows the tax item under Item and the tax agency under Name, on Sales Tax Payable. Add Tax Line = No if you want item lines without the tax rows.

Main Line is Yes, so why do I still see repeated rows?

Something else is adding rows. Results columns or criteria from a related record with many rows per invoice, such as contacts or addresses, return one row per related record even when the invoice is limited to its main line. Remove the related fields and preview again to find the one doing it.

How do I get one row per invoice in a transaction saved search?

Keep Type is Invoice, add Main Line to the criteria, choose Yes in its popup, and click Set. Stick to header-level results like Date, Document Number, Name, and Amount. Preview shows the rows but doesn't save anything, so click Save when the count looks right.