# Creating Pivot Tables

/text/scalc/guide/datapilot_createtable.xhp
pivot tables
pivot table function; calling up and applying
Creating Pivot Tables
- Position the cursor within a range of cells containing values, row and column headings.
- Choose Data - Pivot Table - Create. The Select Source dialog appears. Choose Current selection and confirm with OK. The table headings are shown as buttons in the Pivot Table dialog. Drag these buttons as required and drop them into the layout areas "Page Fields", "Column Fields", "Row Fields" and "Data Fields".
- Drag the desired buttons into one of the four areas.
Drag a button to the Page Fields area to create a button and a listbox on top of the generated pivot table. The listbox can be used to filter the pivot table by the contents of the selected item. You can use drag-and-drop within the generated pivot table to use another page field as a filter.
If the button is dropped in the Data Fields area it will be given a caption that also shows the formula that will be used to calculate the data.
- By double-clicking on one of the fields in the Data Fields area you can call up the Data Field dialog.
- Use the Data Field dialog to select the calculations to be used for the data. To make a multiple selection, press the Command Ctrl key while clicking the desired calculation.
- The order of the buttons can be changed at any time by moving them to a different position in the area with the mouse.
- Remove a button by dragging it back to the area of the other buttons at the right of the dialog.
- To open the Data Field dialog, double-click one of the buttons in the Row or Column area. Use the dialog to select if and to what extent %PRODUCTNAME calculates display subtotals.
Exit the Pivot Table dialog by pressing OK. A Filter button will now be inserted, or a page button for every data field that you dropped in the Page Fields area. The pivot table is inserted further down.