Dashboard Mode - QUERY function basics
Goal
Find out how to use the QUERY function in Google Sheets to filter and sort data easily.
Find out how to use the QUERY function in Google Sheets to filter and sort data easily.
| Product | Category | Price | Sold |
|---|---|---|---|
| Apple | Fruit | 1.2 | 50 |
| Banana | Fruit | 0.8 | 80 |
| Carrot | Vegetable | 0.5 | 40 |
| Broccoli | Vegetable | 1.0 | 30 |
| Orange | Fruit | 1.1 | 60 |
| Potato | Vegetable | 0.3 | 100 |
=SUM(D2:D7)=QUERY(A1:D7, "select A, C, D where B = 'Fruit'", 1)=QUERY(A1:D7, "select A, B, D where D > 50 order by D desc", 1)+----------------------+--------------------------+ | Total Sold | Fruits Only Table | | (KPI) | | | 360 | Product | Price | Sold | +----------------------+--------------------------+ | Products Sold > 50 Table | | Product | Category | Sold | | Potato | Vegetable| 100 | | Banana | Fruit | 80 | | Orange | Fruit | 60 | +-------------------------------------------------+
Add a filter dropdown for Category (Fruit, Vegetable). When you select a category, the Fruits Only Table and Products Sold > 50 Table update to show only products from that category. The Total Sold KPI also updates to sum only the sold units for the selected category.
If you add a filter to show only Vegetables, which components update and what do they show?
QUERY function do in Google Sheets?A | B 1 | 10 2 | 20 3 | 30 4 | 40
=QUERY(A1:B4, "SELECT A WHERE B > 20")?=QUERY(A1:C10, "SELECT A WHERE B = 'Apple')"Product | Region | Sales Apple | East | 100 Banana | West | 150 Apple | West | 200 Banana | East | 120 Apple | East | 130 Banana | West | 170
Pass the test and this pattern moves unknown