Why a report shows one document in many rows ​

A report can show the same document number in several rows. This does not mean that the document is duplicated. The report shows one row for each matching line of data in that document.

Child table columns ​

Many documents have tables inside them, called child tables. For example, a Sales Invoice has a table of Items, and each Item is one row.

When a report includes a column from a child table, the report shows one row for each child row. For example, if Sales Invoice SINV-0001 has 3 Items and the report shows the Item column, the report shows:

text
SINV-0001    Item A
SINV-0001    Item B
SINV-0001    Item C

The invoice is still one document. The report shows it once for each Item.

Other reasons for repeated rows ​

ReasonExample
More than one child table in the reportAn invoice with 3 Items and 2 tax rows can show up to 6 rows when a custom report joins both tables.
A ledger or detail reportThe General Ledger shows one row for each accounting entry. The Stock Ledger shows one row for each stock movement. One document creates many entries.
Linked records with many matchesOne invoice can link to several payments, delivery notes, serial numbers, or batches. A report that shows them repeats the invoice for each match.
A join error in a custom Query ReportA query that joins a child table without child.parent = parent.name returns too many rows. Also check parenttype and parentfield when the child table is used by more than one parent.
No groupingThe report shows details where you want a summary.

Find the cause ​

  1. Open one of the repeated documents.
  2. Check whether it has several rows in a child table, such as Items, Taxes, or Payment Schedule.
  3. Check whether a report column comes from that child table.
  4. For a custom report, review its joins and filters.

Show one row per document ​

Decide whether you need detail rows or a summary. For one row per document:

  • Remove the child table columns from the report.
  • Use only fields of the main document.
  • Group by the document name, and use totals such as sum, count, minimum, or maximum.
  • Build a custom Query Report or Script Report that returns one row per document.

If the report answers an Item, tax, ledger, or stock question, repeated rows are correct.