Resources / Article

NetSuite saved search duplicate results: one row per record

Why a NetSuite saved search returns the same record several times, and how summary types and criteria give you one row per record.

A saved search shows one row for each value of the field you set to Group on the Results subtab (Defining Summary Types to Roll Up Search Results). Add Count or Sum on that same row to bring the figures you need onto the line.

Why a saved search returns more rows than you expect

The Results subtab of an advanced search has a Summary Type column, and that column sets how data is grouped (Defining Summary Types to Roll Up Search Results). With summary types in place, the search returns a summary page, and each group on that page opens to the rows inside it. Oracle's page lists the types you can pick: Group for the field you group by, Count for the number of results in a group, Sum for added values, and Minimum for the lowest amount or the earliest date.

Set a Group summary type on the results subtab

  1. Open the saved search and click Results.
  2. Find the field that should define one row.
  3. Choose Group in the Summary Type column for that field.
  4. Add a second field and set Count.
  5. Add Amount with Sum if you want the money rolled up.
  6. Click Preview.

Oracle's worked example sets Group on one field, then Count on the item field, and clears the Sum sitting on Amount by choosing a blank summary type (Summary Type Example Screenshots). The preview then shows one line per group value, and opening a line reveals the transactions and items underneath. The example counts items sold per customer, and notes that a count usually sits on a name or ID field.

Check the summary type column before you preview

Oracle's example sets Group on one field, Count on another, and clears the Sum that had been sitting on Amount by choosing a blank summary type (Summary Type Example Screenshots). Work through the same settings on your own search, starting with the field you group by.

Tighten the criteria with grouped conditions

A criteria filter removes whole records from the result set, and the Criteria Builder joins conditions with AND and OR, with grouping available so several conditions count as one (Dataset Criteria Filters). Filters can be edited and their order changed, which affects the sequence in which they run, and any field a filter uses is highlighted in the Fields list.

Where a search mixes AND with OR, parentheses group criteria so they apply in the order you intend (Condition Grouping Logic). Oracle's example pairs a subsidiary condition with two locations, then a second subsidiary with a single location, and the grouping decides which rows come back.

If location forms part of your criteria and stock sits across several sites, check the values against NetSuite multi-location inventory.

Build a de-duplicated list as a static group

For a clean list of contacts or customers, a static group works. Go to Lists > Relationships > Groups > New, select Static, and choose the record type. On the Members subtab, use Add With Search, enter your criteria, then click Search & Select (Creating a Static Contact Group). When you pick Contact as the record type, the group can hold members from more than one entity type. Individual contacts can be removed before you save the group.

Choose the field you group on

The field you pick for Group sets the level of the summary page, because the page lists the values of that field (Defining Summary Types to Roll Up Search Results). Oracle's example uses the sales rep field, so the summary page lists reps and each one opens to their customers. Agree that field with the client before you build the search.

Example

A search across one month of sales orders returns 1,860 rows covering 240 orders. Group on the field that identifies the order, Count on Item, Sum on Amount. Preview then shows 240 rows, with Amount totalling about Rs 4.2 crore for the month. A row with a count above one opens to list the lines behind it (Defining Summary Types to Roll Up Search Results). The 1,860 rows are what the same search produced before any summary type was set, which is the count you would quote if someone asked how many lines the month contained.

Group, Count and Sum turn lines into one row per orderTable of Results subtab settings: the field that defines one row is set to Group, Item to Count, Amount to Sum. Before any summary type the month's sales orders return 1,860 rows. After, the preview shows 240 rows, one per order, with Amount totalling about Rs 4.2 crore.Results subtab fieldSummary TypeThe field that defines one row, suchas the orderGroupItemCountAmountSumBefore: one month ofsales orders, 1,860rowsAfter: 240 rows, oneper order. Amountabout Rs 4.2 crore
Summary types on the Results subtab turn 1,860 rows into one row per order.

Trade-offs

The summary page shows one line per group value, and a click on a line opens the rows inside it (Defining Summary Types to Roll Up Search Results).

A criteria filter removes whole records, so a filter added for one report changes what every visualization on that dataset shows (Dataset Criteria Filters).

Common mistakes

FAQ

Why does the same record appear several times?
Set Group on the field you want one row per. The output then lists one entry for each value, and you can open a value to see the rows behind it (Defining Summary Types to Roll Up Search Results).

Does grouping delete data?
No. The output shows one row per group, and you open a group to see the rows inside it (Defining Summary Types to Roll Up Search Results).

How do I count the rows in each group?
Add Count on a name or ID field. Oracle's example uses an item field for the count (Summary Type Example Screenshots).

Can I build a de-duplicated list of contacts or customers?
Yes. A static group built with Add With Search pulls the matching records into the group (Creating a Static Contact Group).

Do criteria on a workbook dataset affect other reports?
Yes. A criteria filter drops whole records from the dataset, and every visualization based on that dataset is affected (Dataset Criteria Filters).

The quick way is mark.: it reads the saved search and the records behind it, finds why a record repeats and tells you the exact fix to apply. Try it free.

Sources

  1. docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/bridgehead_N493908.html
  2. docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_0220112437.html
  3. docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_1121030646.html
  4. docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_1544211200.html
  5. docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_N648820.html
  6. docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_N659760.html

Have mark. check this against the client's own files

mark. reads the client's files and sets each point against them, with the source beside it.

Book a working session

Twenty minutes on one client folder. Your 21-day trial opens on the call.

Start your free trial

Three questions, and Mark opens an account for you on NetSuite.

Which ERP do your clients run?

Your account opens within one working day.