Skip to main content
The Group By tool is one of the most used tools in Less. The Group By tool works by sorting data into boxes where each box represents a group. Once everything is in its box, you can count, total, or summarize what’s in each one. It’s a way to organize and analyze similar items together. To exemplify, “group by customer_type average session_length” could be translated to “put my data in the customer_type column groups and provide an average of the session length for those customer types”.

Configuration

1

Select Column(s) to Group By

Select the column(s) to group by. You can input as many columns as you need. Adding more columns will make your groups/boxes more unique as the “boxes” become more specific.This is technically an optional input. You don’t have to greate any groups if you just want to.
2

1) Select column, 2) select aggregation and 3) new column name (optional)

Add your aggregation(s) pairs by selecting the column you want to aggregate and how you want to aggregate them.You can choose to rename the output column if you want to.You can choose from the following types of aggregations:
  • Sum: summarize numeric values (numeric columns only)
  • Average: find the average of numeric values (numeric columns only)
  • Min: find the smallest numeric value (numeric and datetime columns only)
  • Max: find the largest numeric value (numeric and datetime columns only)
  • Count: count the occurances
  • Count Distinct: count the unique occurances
  • First: get the first value in the group
  • Last: get the last value in the group
  • Concatenate: get all your string values in a comma-separated cell (text columns only)
  • Standard Deviation: find the standard deviation (numeric columns only)
  • Variance: find the variance (numeric columns only)
  • Median: find the median (numeric columns only)
  • Skewness: find the skewness (numeric columns only)
  • Kurtosis: find the kurtosis (numeric columns only)
You can move aggregations up and down by clicking the up and down arrows. You can also delete an aggregation by clicking the X icon. You can add as many aggregations as you need. Click the + Add aggregation button at the bottom of the configuration window to add more.

Example: Without groups

In this example, we have a dataset with a number of different columns. We don’t want to group by any columns, so we leave the “Group By” column(s) empty.
Note that we’ve renamed the columns to make them more readable in the output.

Example: Two groups, counting and renaming

Here we have some questionaire data. We asked some respondents “What’s your favorite analytics product?”. We want to group by the question and answer and count the number of responses for each group. Here you can see our data before we group by - notice that we have 3001 answers.
Here we’ve grouped by the question and answer columns and counted the number of responses for each group. We also renamed the output to answerCount
Evidently the results are quite clear…

Example: First versus Minimum

There’s a difference between the First and Minimum aggregations. The First aggregation gets the first value in the group, while the Minimum aggregation gets the smallest value in the group. We have this dataset:
Below you can see the results of the First and Minimum aggregations.
As you can see, the First aggregation gets the first value, while the Minimum aggregation gets the smallest value. We didn’t use any group by columns, so all the data is in the same group.