Step: Pivot
Overview
Example starting data:
/*---------+-------+---------+------------*
| test | score | student | date |
+---------+-------+---------+------------+
| quiz | 83 | jane | 2020-04-01 |
| quiz | 35 | pat | 2020-04-01 |
| quiz | 89 | sam | 2020-04-01 |
| midterm | 74 | jane | 2020-05-01 |
| midterm | 62 | pat | 2020-05-01 |
| midterm | 93 | sam | 2020-05-01 |
| final | 77 | jane | 2020-06-01 |
| final | 59 | pat | 2020-06-01 |
*---------+-------+---------+------------*/Example output data:
/*---------+------+---------+-------*
| student | quiz | midterm | final |
+---------+------+---------+-------+
| jane | 83 | 74 | 77 |
| pat | 35 | 62 | 59 |
| sam | 89 | 93 | NULL |
*---------+------+---------+-------*/Step structure

Input field definitions
Field
Definition
Field
Definition
Examples
Example 1: Basic pivot

Output data:
Example 2: Pivot with collapse
Starting table:
Input fields:

Pivoted output table:
Example 3: Multiple aggregation variables
Starting table:
Input fields:

Pivoted output table:
Last updated
Was this helpful?

