Pivot lets you create pivot tables that help you explore and summarize your data.
Pivot uses the following utterance:
Pivot on <expression/aggregation> creating rows from <row columns> and columns from <columns> and (using <auto-binning/bin> on <bin column> setting <interval size>/<number of intervals> to <interval number> | calculate percentages for each <percentage row>/<percentage column>)
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.
auto-binning/bin(optional). Whether to automatically bin the values of the bin column or to manually bin them.
bin column(optional). The column whose values to bin.
interval size(optional). If you chose to manually bin the values of the
bin column, this is the size of each bin.
number of intervals(optional). If you chose to manually bin the values of the
bin column, this is the number of bins to use.
percentage row(optional). Whether to calculate percentages for each row in the table.
percentage column(optional). Whether to calculate percentages for each column in the table.
If the data is successfully pivoted, the pivot table appears in the display panel.
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.