Create Pivot Tables
Pivot tables are one of the best features of spreadsheets. Let’s use them in Tabmega.
Adding a pivot table
- Assuming you are following along from the Filter section of the tutorial, you should be on the ratings table. It’s fine to keep the filter applied for
Toy Story (1995)
andJumanji (1995)
, or to remove the filter. It won’t affect the pivot. - Click on the Insert menu at the top of the window, and then Pivot Table.
- You’ll see a new table was created called pivot_1. Ensure that the Source box in the right pivot pane is the ratings table. It should be automatically set to the ratings table if you inserted a pivot while on the ratings table.
- Let’s get the count of ratings by movie title. Click on Add button next to Rows.
- Add
movieTitle
as a row. It should look like the second screenshot after adding. - Click on Add button next to Values.
- Add
userId
as a Value. It should look like the second screenshot after adding. - By default the Summarize By function is
SUM
becauseuserId
is a numeric value. Update the Summarize By dropdown foruserId
to beCOUNTA
which counts non-blanks. There aren’t any duplicate or blank rows, soCOUNTA
will give the same result asCOUNTUNIQUE
and will be slightly faster. - As usual, click Apply for the new pivot table to be calculated. Now we can see the number of users that have rated each movie!