Sorting is one of the most common data manipulations in an analysts' tool kit. Intuitively, sorting is something that our brains already know how to do. When we look at a group of individuals, we can tell the difference between taller and shorter people, without having to think about it, as our minds seek to apply an order to our observations. The ability to compare and order things is a naturally ingrained ability shared by everyone. In this section, we will look at how we can use data tools to apply a sorting functionality to our data sets.
We will approach the sorting functionality by manipulating data in four different ways:
- Ascending (lowest to highest)
- Descending (highest to lowest)
- Limiting data to the Top or Bottom X results (e.g. Top 10)
- How to sort data across multiple fields
The previous lesson showed us how to access data in Google Sheets, as well as learning how to remove duplicates from your data set. In this lesson we'll go over Google Sheets' sorting functionality.
Database and SQL
Now that we've written our first SQL query, we will go over how to sort data in SQL, and learn how to sample data from our tables. We will introduce two new SQL statements in this lesson:
- ORDER BY
After introducing basic BI Software fundamentals in the previous lesson, this lesson will go over how to sort data in Looker.