Creating Summary Searches with Grouping: A Guide to Data Aggregation

Creating Summary Searches with Grouping: A Guide to Data Aggregation

Creating Summary Searches with Grouping: A Guide to Data Aggregation

This guide provides a fact-checked and expanded overview of building summary searches in NetSuite.

This guide provides a fact-checked and expanded overview of building summary searches in NetSuite.

This guide provides a fact-checked and expanded overview of building summary searches in NetSuite.

9 min read

Standard "detail" searches are perfect for listing individual records, but their power is limited when you need to see the bigger picture. Summary searches are the answer. They allow you to aggregate thousands of records into concise, meaningful groups—transforming raw data into high-level insights like total sales per customer, order counts by status, or average transaction value by sales rep. This guide provides a fact-checked and expanded overview of building summary searches in NetSuite.


The Golden Rule of Summary Searches

When you create a summary search, you must adhere to one fundamental rule: every column in your results must have a Summary Type assigned. You cannot mix detail-level columns with aggregated columns. Each field must either be used for grouping or for calculation.


Understanding Summary Types

On the Results subtab of your saved search, you will assign one of the following summary types to each column:

Summary Type

Description

Example Use Case

Group

The cornerstone of your summary. All records with the same value in this field will be combined into a single summary row. This is equivalent to a GROUP BY clause in SQL.

Group by Customer to get one row per customer.

Sum

Adds up all the numeric values within each group.

Sum the Amount field to get total sales per customer.

Count

Counts the number of records within each group.

Count the Internal ID field to get the number of transactions per customer.

Average

Calculates the average (mean) of the numeric values within each group.

Average the Amount field to find the average order size per customer.

Minimum

Finds the lowest value within each group.

Find the Minimum Transaction Date to see the first order date for each customer.

Maximum

Finds the highest value within each group.

Find the Maximum Transaction Date to see the most recent order date for each customer.


Building a Summary Search: A Step-by-Step Example

Goal: Create a search showing total sales by customer.

  1. Create a new Transaction saved search.

  2. On the Criteria subtab, filter for Type is Invoice and Main Line is Yes.

  3. Navigate to the Results subtab.

  4. Add the `Customer` field. Set its Summary Type to Group.

  5. Add the `Amount` field. Set its Summary Type to Sum.

  6. Give the columns clear Custom Labels (e.g., "Customer" and "Total Sales").

  7. Save and run the search. The result will be a list with one row for each customer, showing their total invoice amount.


Criteria vs. Summary Criteria: A Critical Distinction

NetSuite provides two ways to filter summary searches, and understanding the difference is essential.

Standard Criteria (The "Where" Clause)

These filters are applied to the raw data before any grouping or aggregation occurs. Use this for filtering the dataset that goes into your summary.

  • Example: Setting Type is Invoice and Date is this year.

  • Effect: NetSuite first finds all invoices from this year, and then it groups them according to your summary settings.

Summary Criteria (The "Having" Clause)

These filters are applied after the data has been grouped and aggregated. Use this to filter based on the summarized results.

  • Example: Setting Sum of Amount is greater than 50,000.

  • Effect: NetSuite first calculates the total sales for every customer, and then it filters the results to show only those customers whose total is over $50,000.


Advanced Techniques

  • Multi-Level Grouping: You can group by multiple fields to create a more granular summary. For example, grouping by Sales Rep and then by Customer will show you each customer's total, nested under their assigned sales rep.

  • Date Grouping: When grouping by a date field, you can choose the level of aggregation: Year, Quarter, Month, or Week.

  • Formulas in Summaries: You can group by a Formula (Text) field to create custom categories. For instance, use a CASE statement to create aging buckets and then Count the transactions in each bucket.


Best Practices

  • Start with Criteria: Always apply as many standard criteria as possible to reduce the initial dataset. This makes your summary search run much faster.

  • No Drill Down: Remember that summary search results cannot be drilled down into to see the underlying detail records. If users need to see the detail, consider providing a separate, linked detail search.

Dashboard KPIs: Summary searches are the engine behind Key Performance Indicator (KPI) portlets on dashboards. Use them to display high-level metrics like total sales, new leads, or open cases.

Standard "detail" searches are perfect for listing individual records, but their power is limited when you need to see the bigger picture. Summary searches are the answer. They allow you to aggregate thousands of records into concise, meaningful groups—transforming raw data into high-level insights like total sales per customer, order counts by status, or average transaction value by sales rep. This guide provides a fact-checked and expanded overview of building summary searches in NetSuite.


The Golden Rule of Summary Searches

When you create a summary search, you must adhere to one fundamental rule: every column in your results must have a Summary Type assigned. You cannot mix detail-level columns with aggregated columns. Each field must either be used for grouping or for calculation.


Understanding Summary Types

On the Results subtab of your saved search, you will assign one of the following summary types to each column:

Summary Type

Description

Example Use Case

Group

The cornerstone of your summary. All records with the same value in this field will be combined into a single summary row. This is equivalent to a GROUP BY clause in SQL.

Group by Customer to get one row per customer.

Sum

Adds up all the numeric values within each group.

Sum the Amount field to get total sales per customer.

Count

Counts the number of records within each group.

Count the Internal ID field to get the number of transactions per customer.

Average

Calculates the average (mean) of the numeric values within each group.

Average the Amount field to find the average order size per customer.

Minimum

Finds the lowest value within each group.

Find the Minimum Transaction Date to see the first order date for each customer.

Maximum

Finds the highest value within each group.

Find the Maximum Transaction Date to see the most recent order date for each customer.


Building a Summary Search: A Step-by-Step Example

Goal: Create a search showing total sales by customer.

  1. Create a new Transaction saved search.

  2. On the Criteria subtab, filter for Type is Invoice and Main Line is Yes.

  3. Navigate to the Results subtab.

  4. Add the `Customer` field. Set its Summary Type to Group.

  5. Add the `Amount` field. Set its Summary Type to Sum.

  6. Give the columns clear Custom Labels (e.g., "Customer" and "Total Sales").

  7. Save and run the search. The result will be a list with one row for each customer, showing their total invoice amount.


Criteria vs. Summary Criteria: A Critical Distinction

NetSuite provides two ways to filter summary searches, and understanding the difference is essential.

Standard Criteria (The "Where" Clause)

These filters are applied to the raw data before any grouping or aggregation occurs. Use this for filtering the dataset that goes into your summary.

  • Example: Setting Type is Invoice and Date is this year.

  • Effect: NetSuite first finds all invoices from this year, and then it groups them according to your summary settings.

Summary Criteria (The "Having" Clause)

These filters are applied after the data has been grouped and aggregated. Use this to filter based on the summarized results.

  • Example: Setting Sum of Amount is greater than 50,000.

  • Effect: NetSuite first calculates the total sales for every customer, and then it filters the results to show only those customers whose total is over $50,000.


Advanced Techniques

  • Multi-Level Grouping: You can group by multiple fields to create a more granular summary. For example, grouping by Sales Rep and then by Customer will show you each customer's total, nested under their assigned sales rep.

  • Date Grouping: When grouping by a date field, you can choose the level of aggregation: Year, Quarter, Month, or Week.

  • Formulas in Summaries: You can group by a Formula (Text) field to create custom categories. For instance, use a CASE statement to create aging buckets and then Count the transactions in each bucket.


Best Practices

  • Start with Criteria: Always apply as many standard criteria as possible to reduce the initial dataset. This makes your summary search run much faster.

  • No Drill Down: Remember that summary search results cannot be drilled down into to see the underlying detail records. If users need to see the detail, consider providing a separate, linked detail search.

Dashboard KPIs: Summary searches are the engine behind Key Performance Indicator (KPI) portlets on dashboards. Use them to display high-level metrics like total sales, new leads, or open cases.

Ready to Work Together?

Ready to Work Together?

Ready to Work Together?

Let us talk about your NetSuite challenges and how we can help. No pressure, no sales pitch. Just a straightforward conversation.

Let us talk about your NetSuite challenges and how we can help. No pressure, no sales pitch. Just a straightforward conversation.

Author

Michael Strong

Michael Strong

Founder & Principal Architect

Founder & Principal Architect

Tags

Read More

Read More