Summarize Data in Query

You can summarize data in your query by using the Measure and Group By options in the Summary building block. Following the steps from How to Create a Query. Here are the steps to summarize data in a query.

  1. Go to Analytics > Dashboard Manager > Queries.

  2. Open an existing query.

  3. Click + under the default Series (S1) building block.

  4. In the Add building block menu:

    1. Select Summary.

      Add building block menu listing Join, Filter, and Summary, with Summary selected.
      Add building block menu
  5. In the Summary section:

    1. Click Measure By.

    2. Select the column for measure.

    3. Click Group By.

    4. Select the column for grouping.

    5. Close the summary setting section.

      Summary section with one measure and one grouping. The measure is Gapminder Population, aggregated by Sum, with the name m1. The data is grouped by Gapminder Country. Below are the Measure By and Group By buttons.
      Summary settings
  6. Click Save.

The resulting query flows from the Series building block through the Summary building block to the Output.

Demo Query in the query editor, showing three connected building blocks. Series S1 with the Gapminder source, Summary SUM1 with the sum of Population by Gapminder Country, and Output. A Valid label appears at the top of the editor.
Query with a summary applied

Example

Summary on Population Grouped by Country

The following example shows summarized data. Measure is applied on Population, aggregated as a Sum. Data is grouped by Country.

Not Summarized

Shows an example of the initial, non-summarized dataset.

Output preview table with one row per country and year, showing Afghanistan rows for the years 1950 to 1959. Columns include Country, Fertility, Life Expectancy, Population, Region, and Year.
Data before summarization

Summarized

Shows an example of what the summarized data would look like after applying the steps.

Output preview table with one row per country and two columns, Gapminder Country and the sum of Gapminder Population. Countries from Afghanistan to Austria are listed, each with its total population.
Data after summarization