Before you create a pivot table, it is important to

Create a database
Sort a database

Clean and organize your data

Ensure all necessary data is included in the database
Verify the accuracy of the data in the database
Define the fields or columns you want to use in the pivot table
Determine the relationships between the different fields in the database