![]() In addition to the group subtotals, the pivot table also includes both row and column grand totals: But now the pivot table has grouped the rows related to Alaska, and given a subtotal for those Alaskan rows, allowing us to see the answer to our question: Alaskans purchased 103 Doohickeys from 2016–2020, totaling $6,900.43. Like the flat table, the pivot table lets us see, for example, that in 2020 our customers in Alaska (AK) have purchased a combined 11 Doohickey products for $867.63. rows: User → State and Created At (by year).In our pivot table, Metabase has set the rows, columns, and values as follows: At the bottom left of your screen, click Visualization > Pivot table. To find out, we could add up the subtotals ourselves, or use a pivot table to calculate that figure for us. Now, let’s say that for each state, we also want to know the sum of the annual subtotals for each state (e.g., how much money did orders for Doohickey products make in Alaska for all years?). The resulting table is a regular one, with rows for each combination of state, year, and product category. ![]() (Note that, even though we’ve only selected the Orders table in the data section, Metabase will automatically join the Products and People tables to get the State and Category data.) For each group (say Alaska in 2017), we count the number of orders and add up the subtotals for those orders. We’re grouping the orders by User → State, Created At (by year), and Product → Category. Here we’re taking data from the Orders table and summarizing the records. Notebook Editor with a preview of the question's results. Here’s our query using the Notebook Editor: Fig. and how those orders break down by product category. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |