Pivot
Pivot
lets you create pivot tables that help you explore and summarize your data.
Format
Pivot
uses a single format with several variations: Pivot on <expression/aggregation> creating rows from <row columns> and columns from <columns> using (auto-binning on <bin column> | bin on <bin column> with (interval_size <number> | number_of_intervals <number>) and calculate percentages for each (row | column)
.
Parameters
Pivot
uses the following parameters:
expression/aggregation
(required). The expression (created by the Define skill) or the aggregation to use in the table. See Compute for more information on aggregations.row columns
(required). A comma-separated list of columns whose values to use as the table's rows.columns
(required). A comma-separated list of the columns whose values to use as the table's columns.bin column
(optional). The column whose values to bin.interval size
(optional). If you chose to manually bin the values of thebin column
, this is the size of each bin.number of intervals
(optional). If you chose to manually bin the values of thebin column
, this is the number of bins to use.
Output
If the data is successfully pivoted, the pivot table appears in the Data tab.
Examples
Consider a dataset that represents the Titanic's passenger list with the following columns:
- Age. The passenger's age.
- Gender. The passenger's gender.
- Name. The passenger's name.
- PClass. The passenger's ticket class.
- Survived. Whether the passenger survived the disaster.
To summarize the data by calculating the average age for each gender in each ticket class, enter Pivot on average Age creating rows from Pclass and columns from Gender
.
To summarize the data by calculating the percentage of passengers (male and female) in each ticket class that survived, enter Pivot on count of Gender creating rows from Pclass and columns from Survived, and calculate percentages for each row
.