The pivot by feature
provides an easy, yet very powerful, way to summarize data for analytics.
You can specify a column to use as a categorical variable and the
distinct values to use. When the query is run, the output table is
summarized with the aggregations that you apply to the columns of
interest.
To use the pivot by
feature:
-
On the
Column
Editor tab, place your pointer in the
Pivot
By cell for the column to use as the pivot column. Click
the ellipsis button to select the pivot column and values.
-
On the
Pivot
Values dialog box, select the pivot by column. You can
enter search criteria in the text box to filter the column names.
The following display
shows an example of pivoting on three values of the Product_Category
column.
Pivot Values
-
After the distinct values
for the column are determined, select the check boxes for the values
to use in the summarization. Click
Apply.
The following display
shows an example of the
Column Editor tab
when a pivot by column is used. The minimum and maximum Total_Retail_Price
are calculated for each Customer_ID and are then pivoted by (transposed)
three values of the Product_Category column. Notice that TRP is specified
as a label for the Total_Retail_Price column.
Column Editor Tab with a Pivot By Column
The following display
shows how pivoting the Customer_ID column by three values of the Product_Category
column results in additional output columns. A substring of the pivot
by values is used as a prefix to the column name and the aggregation
method is used as a suffix. The pivot by column label and aggregation
method are used in the output column label.
Output Columns Tab with Pivot By Values